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

From: Date: Tue, 15 Aug 2006 21:44:30 +0000
Subject: cvs: pear /MDB2_Schema/MDB2/Schema Parser.php Validate.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-41619@lists.php.net to get a copy of this message
lsmith Tue Aug 15 21:44:30 2006 UTC Modified files: /pear/MDB2_Schema/MDB2/Schema Parser.php Validate.php Log: - quick fixes for parser context information handling on errors http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema/Parser.php?r1=1.39&r2=1.40&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema/Parser.php diff -u pear/MDB2_Schema/MDB2/Schema/Parser.php:1.39 pear/MDB2_Schema/MDB2/Schema/Parser.php:1.40 --- pear/MDB2_Schema/MDB2/Schema/Parser.php:1.39 Tue Aug 15 20:02:50 2006 +++ pear/MDB2_Schema/MDB2/Schema/Parser.php Tue Aug 15 21:44:30 2006 @@ -42,7 +42,7 @@ // | Author: Christian Dickmann <dickmann@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Parser.php,v 1.39 2006/08/15 20:02:50 ifeghali Exp $ +// $Id: Parser.php,v 1.40 2006/08/15 21:44:30 lsmith Exp $ // require_once 'XML/Parser.php'; @@ -208,7 +208,7 @@ case 'database-table-initialization-update-field': /* field are now accepting functions and expressions we can't determine the return type of them - $result = $this->val->validateInsertField($this); */ + $result = $this->val->validateInsertField($this, $xp); */ break; case 'database-table-initialization-insert-field-function': case 'database-table-initialization-update-field-function': @@ -229,38 +229,38 @@ case 'database-table-initialization-insert': case 'database-table-initialization-delete': case 'database-table-initialization-update': - $result = $this->val->validateDML($this); + $result = $this->val->validateDML($this, $xp); break; /* Table definition */ case 'database-table': - $result = $this->val->validateTable($this); + $result = $this->val->validateTable($this, $xp); break; case 'database-table-name': - $result = $this->val->validateTableName($this); + $result = $this->val->validateTableName($this, $xp); break; /* Field declaration */ case 'database-table-declaration-field': - $result = $this->val->validateField($this); + $result = $this->val->validateField($this, $xp); break; /* Index declaration */ case 'database-table-declaration-index': - $result = $this->val->validateIndex($this); + $result = $this->val->validateIndex($this, $xp); break; case 'database-table-declaration-index-field': - $result = $this->val->validateIndexField($this); + $result = $this->val->validateIndexField($this, $xp); break; /* Sequence declaration */ case 'database-sequence': - $result = $this->val->validateSequence($this); + $result = $this->val->validateSequence($this, $xp); break; /* End of File */ case 'database': - $result = $this->val->validateDatabase($this); + $result = $this->val->validateDatabase($this, $xp); break; } http://cvs.php.net/viewvc.cgi/pear/MDB2_Schema/MDB2/Schema/Validate.php?r1=1.4&r2=1.5&diff_format=u Index: pear/MDB2_Schema/MDB2/Schema/Validate.php diff -u pear/MDB2_Schema/MDB2/Schema/Validate.php:1.4 pear/MDB2_Schema/MDB2/Schema/Validate.php:1.5 --- pear/MDB2_Schema/MDB2/Schema/Validate.php:1.4 Tue Aug 15 20:02:50 2006 +++ pear/MDB2_Schema/MDB2/Schema/Validate.php Tue Aug 15 21:44:30 2006 @@ -43,7 +43,7 @@ // | Author: Igor Feghali <ifeghali@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Validate.php,v 1.4 2006/08/15 20:02:50 ifeghali Exp $ +// $Id: Validate.php,v 1.5 2006/08/15 21:44:30 lsmith Exp $ // /** @@ -91,7 +91,7 @@ } /* Definition */ - function validateTable(&$schema) + function validateTable(&$schema, $xp) { if (!$schema->table_name) { $schema->raiseError('a table has to have a name', null, $xp); @@ -173,7 +173,7 @@ return true; } - function validateField(&$schema) + function validateField(&$schema, $xp) { if (!$schema->field_name) { $schema->raiseError('field name missing', null, $xp); @@ -245,7 +245,7 @@ return true; } - function validateIndex(&$schema) + function validateIndex(&$schema, $xp) { if (!$schema->index_name) { $schema->raiseError('an index has to have a name', null, $xp); @@ -267,7 +267,7 @@ return true; } - function validateIndexField(&$schema) + function validateIndexField(&$schema, $xp) { if (!$schema->field_name) { $schema->raiseError('the index-field-name is required', null, $xp); @@ -282,7 +282,7 @@ return true; } - function validateTableName(&$schema) + function validateTableName(&$schema, $xp) { if (isset($schema->structure['tables'][$schema->table_name])) { $schema->table = $schema->structure['tables'][$schema->table_name]; @@ -290,7 +290,7 @@ return true; } - function validateSequence(&$schema) + function validateSequence(&$schema, $xp) { if (!$schema->seq_name) { $schema->raiseError('a sequence has to have a name', null, $xp); @@ -321,7 +321,7 @@ return true; } - function validateDatabase(&$schema) + function validateDatabase(&$schema, $xp) { if (!isset($schema->database_definition['name']) || !$schema->database_definition['name']) { $schema->raiseError('a database has to have a name', null, $xp); @@ -362,7 +362,7 @@ } /* Data Manipulation */ - function validateInsertField(&$schema) + function validateInsertField(&$schema, $xp) { if (!$schema->init_name) { $schema->raiseError('field-name has to be specified', null, $xp); @@ -382,13 +382,13 @@ return true; } - function validateDML(&$schema) + function validateDML(&$schema, $xp) { $schema->table['initialization'][] = $schema->init; return true; } - function validateFieldValue(&$schema, $field_name, &$field_value, &$xp) + function validateFieldValue(&$schema, $field_name, &$field_value, $xp) { if (!isset($schema->table['fields'][$field_name])) { return $schema->raiseError('"'.$field_name.'" is not defined', null, $xp);

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