cvs: pear /MDB2_Schema/MDB2/Schema Validate.php

From: Date: Tue, 29 Aug 2006 17:15:21 +0000
Subject: cvs: pear /MDB2_Schema/MDB2/Schema Validate.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41914@lists.php.net to get a copy of this message
lsmith Tue Aug 29 17:15:21 2006 UTC Modified files: /pear/MDB2_Schema/MDB2/Schema Validate.php Log: - cosmetics http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema/Validate.php?r1=1.23&r2=1.24&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema/Validate.php diff -u pear/MDB2_Schema/MDB2/Schema/Validate.php:1.23 pear/MDB2_Schema/MDB2/Schema/Validate.php:1.24 --- pear/MDB2_Schema/MDB2/Schema/Validate.php:1.23 Tue Aug 29 12:48:16 2006 +++ pear/MDB2_Schema/MDB2/Schema/Validate.php Tue Aug 29 17:15:21 2006 @@ -43,7 +43,7 @@ // | Author: Igor Feghali <ifeghali@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Validate.php,v 1.23 2006/08/29 12:48:16 lsmith Exp $ +// $Id: Validate.php,v 1.24 2006/08/29 17:15:21 lsmith Exp $ // /** @@ -167,6 +167,12 @@ 'a table has to have a name'); } + /* Table name duplicated? */ + if (isset($tables[$table_name])) { + return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, + 'table "'.$table_name.'" already exists'); + } + /* Table name reserved? */ if (is_array($this->fail_on_invalid_names)) { $name = strtoupper($table_name); @@ -178,12 +184,6 @@ } } - /* Table name duplicated? */ - if (isset($tables[$table_name])) { - return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, - 'table "'.$table_name.'" already exists'); - } - /* Was */ if (empty($table['was'])) { $table['was'] = $table_name; @@ -478,6 +478,12 @@ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, 'a sequence has to have a name'); } + + if (isset($sequences[$sequence_name])) { + return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, + 'sequence "'.$sequence_name.'" already exists'); + } + if (is_array($this->fail_on_invalid_names)) { $name = strtoupper($sequence_name); foreach ($this->fail_on_invalid_names as $rdbms) { @@ -488,11 +494,6 @@ } } - if (isset($sequences[$sequence_name])) { - return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, - 'sequence "'.$sequence_name.'" already exists'); - } - if (empty($sequence['was'])) { $sequence['was'] = $sequence_name; } @@ -556,10 +557,8 @@ } /* - * Checking Sequences - * this have to be done here as we can't - * guarantee that all tables were already - * defined in the moment we are parssing indexes + * This have to be done here as we can't guarantee that all tables + * were already defined in the moment we are parsing indexes */ if (isset($database['sequences'])) { foreach ($database['sequences'] as $seq_name => $seq) { @@ -656,7 +655,7 @@ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, '"'.$field_value.'" is not of type "'.$field_def['type'].'"'); } - $field_value = (int) $field_value; + $field_value = (int)$field_value; if (!empty($field_def['unsigned']) && $field_def['unsigned'] && $field_value < 0) { return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, '"'.$field_value.'" signed instead of unsigned'); @@ -698,7 +697,7 @@ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE, '"'.$field_value.'" is not of type "'.$field_def['type'].'"'); } - $field_value = (double) $field_value; + $field_value = (double)$field_value; break; } return true;

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