cvs: pear /MDB2_Schema/MDB2/Schema Parser.php
| From: | Lukas Smith | Date: | Tue, 21 Mar 2006 09:38:12 +0000 |
| Subject: | cvs: pear /MDB2_Schema/MDB2/Schema Parser.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39219@lists.php.net to get a copy of this message | ||
lsmith Tue Mar 21 09:38:12 2006 UTC
Modified files:
/pear/MDB2_Schema/MDB2/Schema Parser.php
Log:
- begun work on allow CURRENT_* in temporal types (bug #6416)
http://cvs.php.net/viewcvs.cgi/pear/MDB2_Schema/MDB2/Schema/Parser.php?r1=1.28&r2=1.29&diff_format=u
Index: pear/MDB2_Schema/MDB2/Schema/Parser.php
diff -u pear/MDB2_Schema/MDB2/Schema/Parser.php:1.28 pear/MDB2_Schema/MDB2/Schema/Parser.php:1.29
--- pear/MDB2_Schema/MDB2/Schema/Parser.php:1.28 Tue Mar 21 09:25:09 2006
+++ pear/MDB2_Schema/MDB2/Schema/Parser.php Tue Mar 21 09:38:12 2006
@@ -42,7 +42,7 @@
// | Author: Christian Dickmann <dickmann@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Parser.php,v 1.28 2006/03/21 09:25:09 lsmith Exp $
+// $Id: Parser.php,v 1.29 2006/03/21 09:38:12 lsmith Exp $
//
require_once 'XML/Parser.php';
@@ -510,19 +510,25 @@
}
break;
case 'date':
- if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/', $field_value)) {
+ if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/', $field_value)
+ && $field_value !== 'CURRENT_DATE'
+ ) {
return $this->raiseError('"'.$field_value.'" is not of
type "'.
$field_def['type'].'"', null, $xp);
}
break;
case 'timestamp':
- if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})
([0-9]{2}):([0-9]{2}):([0-9]{2})/', $field_value)) {
+ if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})
([0-9]{2}):([0-9]{2}):([0-9]{2})/', $field_value)
+ && $field_value !== 'CURRENT_TIMESTAMP'
+ ) {
return $this->raiseError('"'.$field_value.'" is not of
type "'.
$field_def['type'].'"', null, $xp);
}
break;
case 'time':
- if (!preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $field_value)) {
+ if (!preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2})/", $field_value)
+ && $field_value !== 'CURRENT_TIME'
+ ) {
return $this->raiseError('"'.$field_value.'" is not of
type "'.
$field_def['type'].'"', null, $xp);
}