cvs: pear /LiveUser_Admin/Storage SQL.php
| From: | Lukas Smith | Date: | Sat, 19 Aug 2006 15:55:57 +0000 |
| Subject: | cvs: pear /LiveUser_Admin/Storage SQL.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-41718@lists.php.net to get a copy of this message | ||
lsmith Sat Aug 19 15:55:57 2006 UTC
Modified files:
/pear/LiveUser_Admin/Storage SQL.php
Log:
- better handling of '*' inside the field list together with explicit fields (Bug #7955)
http://cvs.php.net/viewvc.cgi/pear/LiveUser_Admin/Storage/SQL.php?r1=1.61&r2=1.62&diff_format=u
Index: pear/LiveUser_Admin/Storage/SQL.php
diff -u pear/LiveUser_Admin/Storage/SQL.php:1.61 pear/LiveUser_Admin/Storage/SQL.php:1.62
--- pear/LiveUser_Admin/Storage/SQL.php:1.61 Fri Aug 18 10:00:11 2006
+++ pear/LiveUser_Admin/Storage/SQL.php Sat Aug 19 15:55:56 2006
@@ -57,7 +57,7 @@
* @author Bjoern Kraus <krausbn@php.net>
* @copyright 2002-2006 Markus Wolff
* @license http://www.gnu.org/licenses/lgpl.txt
- * @version CVS: $Id: SQL.php,v 1.61 2006/08/18 10:00:11 lsmith Exp $
+ * @version CVS: $Id: SQL.php,v 1.62 2006/08/19 15:55:56 lsmith Exp $
* @link http://pear.php.net/LiveUser_Admin
*/
@@ -377,9 +377,26 @@
{
if (!is_array($fields) || empty($fields)) {
$fields = array_keys($this->tables[$root_table]['fields']);
- } elseif (($key = array_search('*', $fields)) !== false) {
- unset($fields[$key]);
- $fields = array_merge($fields,
array_keys($this->tables[$root_table]['fields']));
+ } elseif (($pos = array_search('*', $fields)) !== false) {
+var_dump($fields);
+ $fields_tmp = array();
+ foreach ($fields as $key => $field) {
+ if ($pos == $key) {
+ $fields_default =
array_diff(array_keys($this->tables[$root_table]['fields']), $fields);
+ foreach ($fields_default as $field) {
+ if (!in_array($field, $fields_tmp)) {
+ $fields_tmp[] = $field;
+ }
+ }
+ } else {
+ if (!in_array($field, $fields_tmp)) {
+ $fields_tmp[] = $field;
+ }
+ }
+ }
+ $fields = array_unique($fields_tmp);
+var_dump($fields);
+die();
}
$types = array();