cvs: pear /DB_DataObject/DataObject Generator.php

[email protected] ("Alan Knowles")
Newsgroups php.pear.cvs
Message-ID <cvsalan_k1209436051@cvsserver>
alan_k		Tue Apr 29 02:27:31 2008 UTC

  Modified files:              
    /pear/DB_DataObject/DataObject	Generator.php 
  Log:
  fix bug #13788 - test for error before re-writing definition table for MDB2  in Generator
  
http://cvs.php.net/viewvc.cgi/pear/DB_DataObject/DataObject/Generator.php?r1=1.144&r2=1.145&diff_format=u
Index: pear/DB_DataObject/DataObject/Generator.php
diff -u pear/DB_DataObject/DataObject/Generator.php:1.144 pear/DB_DataObject/DataObject/Generator.php:1.145
--- pear/DB_DataObject/DataObject/Generator.php:1.144	Tue Apr 29 02:22:47 2008
+++ pear/DB_DataObject/DataObject/Generator.php	Tue Apr 29 02:27:31 2008
@@ -15,7 +15,7 @@
  * @author     Alan Knowles <[email protected]>
  * @copyright  1997-2006 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: Generator.php,v 1.144 2008/04/29 02:22:47 alan_k Exp $
+ * @version    CVS: $Id: Generator.php,v 1.145 2008/04/29 02:27:31 alan_k Exp $
  * @link       http://pear.php.net/package/DB_DataObject
  */
  
@@ -269,12 +269,7 @@
             } else {
                 $defs =  $__DB->reverse->tableInfo($quotedTable);
                 // rename the length value, so it matches db's return.
-                foreach ($defs as $k => $v) {
-                    if (!isset($defs[$k]['length'])) {
-                        continue;
-                    }
-                    $defs[$k]['len'] = $defs[$k]['length'];
-                }
+                
             }
 
             if (is_a($defs,'PEAR_Error')) {
@@ -290,7 +285,10 @@
                 if (!is_array($def)) {
                     continue;
                 }
-
+                // rename the length value, so it matches db's return.
+                if (isset($def['length']) && !isset($def['len'])) {
+                    $def['len'] = $dev['length'];
+                }
                 $this->_definitions[$table][] = (object) $def;
 
             }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.