cvs: pear /MDB manager.php

From: Date: Fri, 23 Aug 2002 11:46:02 +0000
Subject: cvs: pear /MDB manager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5898@lists.php.net to get a copy of this message
lsmith Fri Aug 23 07:46:02 2002 EDT Modified files: /pear/MDB manager.php Log: minor bugfix to handling warnings if ambiguity is detected during xml reverse engineering Index: pear/MDB/manager.php diff -u pear/MDB/manager.php:1.43 pear/MDB/manager.php:1.44 --- pear/MDB/manager.php:1.43 Wed Aug 21 09:01:58 2002 +++ pear/MDB/manager.php Fri Aug 23 07:45:59 2002 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: manager.php,v 1.43 2002/08/21 13:01:58 lsmith Exp $ +// $Id: manager.php,v 1.44 2002/08/23 11:45:59 lsmith Exp $ // require_once 'PEAR.php'; @@ -1675,12 +1675,16 @@ } } $this->database_definition['TABLES'][$table_name]['FIELDS'][$field_name] = $definition[0][0]; - for($field_choice = 0, $field_choices = count($definition[0]); - $field_choice < $field_choices; - $field_choice++) - { - $this->warnings[] = "there is ambiguity in the table: $table_name - with the field: $field_name.".serialize($definition[0][$field_choice]); + $field_choices = count($definition[0]); + if($field_choices > 1) { + $warning = "There are $field_choices type choices in the table $table_name field $field_name (#1 is the default): "; + for($field_choice = 0; + $field_choice < $field_choices; + $field_choice++) + { + $warning .= "choice #".($field_choice+1).": ".serialize($definition[0][$field_choice]); + } + $this->warnings[] = $warning; } if(isset($definition[1])) { $sequence = $definition[1]['definition']; @@ -1765,7 +1769,7 @@ * @param integer $dump constant that determines what data to dump * MDB_MANAGER_DUMP_ALL : the entire db * MDB_MANAGER_DUMP_STRUCTURE : only the structure of the db - * MDB_MANAGER_DUMP_CONTANT : only the content of the db + * MDB_MANAGER_DUMP_CONTENT : only the content of the db * @return mixed DB_OK on success, or a MDB error object * @access public */

« previous php.pear.cvs (#5898) next »