cvs: pear /MDB manager.php

From: Date: Tue, 13 Aug 2002 18:56:56 +0000
Subject: cvs: pear /MDB manager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5724@lists.php.net to get a copy of this message
lsmith Tue Aug 13 14:56:56 2002 EDT Modified files: /pear/MDB manager.php Log: minor bug fix added warning if field name is an invalid field name for any RDBMS Index: pear/MDB/manager.php diff -u pear/MDB/manager.php:1.36 pear/MDB/manager.php:1.37 --- pear/MDB/manager.php:1.36 Mon Aug 12 15:32:55 2002 +++ pear/MDB/manager.php Tue Aug 13 14:56:56 2002 @@ -42,7 +42,7 @@ // | Author: Lukas Smith <smith@dybnet.de> | // +----------------------------------------------------------------------+ // -// $Id: manager.php,v 1.36 2002/08/12 19:32:55 lsmith Exp $ +// $Id: manager.php,v 1.37 2002/08/13 18:56:56 lsmith Exp $ // require_once 'PEAR.php'; @@ -74,6 +74,23 @@ 'create' => 0, 'TABLES' => array() ); + var $invalid_names = array( + 'user' => array(), + 'is' => array(), + 'file' => array( + 'oci' => array(), + 'oracle' => array() + ), + 'notify' => array( + 'pgsql' => array() + ), + 'restrict' => array( + 'mysql' => array() + ), + 'password' => array( + 'ibase' => array() + ) + ); // }}} // {{{ captureDebugOutput() @@ -364,7 +381,7 @@ $this->warnings[] = 'Index allready exists: '.$index_name; if ($overwrite) { $this->database->debug('Overwritting Index'); - $result = $this->database->dropIndex($index_name); + $result = $this->database->dropIndex($table_name, $index_name); if (MDB::isError($result)) { break; } @@ -1760,6 +1777,9 @@ 'it was not specified the type of the field "'.$field_name.'" of the table "'.$table_name, 'MDB_Error', TRUE); } $buffer .=("$eol <field>$eol <name>$field_name</name>$eol <type>".$field['type']."</type>$eol"); + if(in_array($field_name, array_keys($this->invalid_names))) { + $this->warnings[] = "invalid field name: $field_name. You will need to set the class var \$fail_on_invalid_names to FALSE"; + } switch($field['type']) { case 'integer': if (isset($field['unsigned'])) {

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