summaryrefslogtreecommitdiffstats
path: root/3rdparty/MDB2/Schema
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-05-13 20:49:39 +0200
committerRobin Appelman <icewind@owncloud.com>2012-05-13 20:53:55 +0200
commit77e2387d94b7f6c9574cbed8a5d242628391906c (patch)
tree115763ce8937aea7a51d294152b66f59d71c1ae1 /3rdparty/MDB2/Schema
parentddf0903ace00d201e4575790d9e910b2bc24496b (diff)
downloadnextcloud-server-77e2387d94b7f6c9574cbed8a5d242628391906c.tar.gz
nextcloud-server-77e2387d94b7f6c9574cbed8a5d242628391906c.zip
more MDB2 updates
Diffstat (limited to '3rdparty/MDB2/Schema')
-rw-r--r--3rdparty/MDB2/Schema/Parser.php132
-rw-r--r--3rdparty/MDB2/Schema/Parser2.php247
-rw-r--r--3rdparty/MDB2/Schema/Reserved/ibase.php95
-rw-r--r--3rdparty/MDB2/Schema/Reserved/mssql.php96
-rw-r--r--3rdparty/MDB2/Schema/Reserved/mysql.php97
-rw-r--r--3rdparty/MDB2/Schema/Reserved/oci8.php96
-rw-r--r--3rdparty/MDB2/Schema/Reserved/pgsql.php97
-rw-r--r--3rdparty/MDB2/Schema/Tool.php71
-rw-r--r--3rdparty/MDB2/Schema/Tool/ParameterException.php63
-rw-r--r--3rdparty/MDB2/Schema/Validate.php264
-rw-r--r--3rdparty/MDB2/Schema/Writer.php57
11 files changed, 907 insertions, 408 deletions
diff --git a/3rdparty/MDB2/Schema/Parser.php b/3rdparty/MDB2/Schema/Parser.php
index 9e8e74b6317..cfd0c37d8a3 100644
--- a/3rdparty/MDB2/Schema/Parser.php
+++ b/3rdparty/MDB2/Schema/Parser.php
@@ -1,8 +1,6 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
/**
- * PHP versions 4 and 5
- *
- * Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
* Stig. S. Bakken, Lukas Smith, Igor Feghali
* All rights reserved.
*
@@ -39,21 +37,17 @@
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * Author: Christian Dickmann <dickmann@php.net>
- * Author: Igor Feghali <ifeghali@php.net>
- *
- * $Id: Parser.php,v 1.68 2008/11/30 03:34:00 clockwerx Exp $
+ * PHP version 5
*
* @category Database
* @package MDB2_Schema
* @author Christian Dickmann <dickmann@php.net>
* @author Igor Feghali <ifeghali@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: Parser.php,v 1.68 2008/11/30 03:34:00 clockwerx Exp $
+ * @version SVN: $Id$
* @link http://pear.php.net/packages/MDB2_Schema
*/
-
require_once 'XML/Parser.php';
require_once 'MDB2/Schema/Validate.php';
@@ -114,27 +108,83 @@ class MDB2_Schema_Parser extends XML_Parser
var $val;
+ /**
+ * PHP 5 constructor
+ *
+ * @param array $variables mixed array with user defined schema
+ * variables
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $structure multi dimensional array with
+ * database schema and data
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
function __construct($variables, $fail_on_invalid_names = true,
- $structure = false, $valid_types = array(),
- $force_defaults = true)
- {
+ $structure = false, $valid_types = array(), $force_defaults = true,
+ $max_identifiers_length = null
+ ) {
// force ISO-8859-1 due to different defaults for PHP4 and PHP5
// todo: this probably needs to be investigated some more andcleaned up
- parent::XML_Parser('ISO-8859-1');
+ parent::__construct('ISO-8859-1');
$this->variables = $variables;
$this->structure = $structure;
- $this->val =& new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
+ $this->val = new MDB2_Schema_Validate(
+ $fail_on_invalid_names,
+ $valid_types,
+ $force_defaults,
+ $max_identifiers_length
+ );
}
+ /**
+ * PHP 4 compatible constructor
+ *
+ * @param array $variables mixed array with user defined schema
+ * variables
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $structure multi dimensional array with
+ * database schema and data
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
function MDB2_Schema_Parser($variables, $fail_on_invalid_names = true,
- $structure = false, $valid_types = array(),
- $force_defaults = true)
- {
+ $structure = false, $valid_types = array(), $force_defaults = true,
+ $max_identifiers_length = null
+ ) {
$this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
}
- function startHandler($xp, $element, $attribs)
+ /**
+ * Triggered when reading a XML open tag <element>
+ *
+ * @param resource $xp xml parser resource
+ * @param string $element element name
+ * @param array $attribs attributes
+ *
+ * @return void
+ * @access private
+ * @static
+ */
+ function startHandler($xp, $element, &$attribs)
{
if (strtolower($element) == 'variable') {
$this->var_mode = true;
@@ -335,12 +385,21 @@ class MDB2_Schema_Parser extends XML_Parser
'start' => '',
'description' => '',
'comments' => '',
- 'on' => array('table' => '', 'field' => '')
);
break;
}
}
+ /**
+ * Triggered when reading a XML close tag </element>
+ *
+ * @param resource $xp xml parser resource
+ * @param string $element element name
+ *
+ * @return void
+ * @access private
+ * @static
+ */
function endHandler($xp, $element)
{
if (strtolower($element) == 'variable') {
@@ -503,7 +562,21 @@ class MDB2_Schema_Parser extends XML_Parser
$this->element = implode('-', $this->elements);
}
- function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE)
+ /**
+ * Pushes a MDB2_Schema_Error into stack and returns it
+ *
+ * @param string $msg textual message
+ * @param int $xmlecode PHP's XML parser error code
+ * @param resource $xp xml parser resource
+ * @param int $ecode MDB2_Schema's error code
+ *
+ * @return object
+ * @access private
+ * @static
+ */
+ static function &raiseError($msg = null, $xmlecode = 0, $xp = null, $ecode = MDB2_SCHEMA_ERROR_PARSE, $userinfo = null,
+ $error_class = null,
+ $skipmsg = false)
{
if (is_null($this->error)) {
$error = '';
@@ -530,11 +603,21 @@ class MDB2_Schema_Parser extends XML_Parser
$error .= "\n";
- $this->error =& MDB2_Schema::raiseError($ecode, null, null, $error);
+ $this->error = MDB2_Schema::raiseError($ecode, null, null, $error);
}
return $this->error;
}
+ /**
+ * Triggered when reading data in a XML element (text between tags)
+ *
+ * @param resource $xp xml parser resource
+ * @param string $data text
+ *
+ * @return void
+ * @access private
+ * @static
+ */
function cdataHandler($xp, $data)
{
if ($this->var_mode == true) {
@@ -806,6 +889,9 @@ class MDB2_Schema_Parser extends XML_Parser
case 'database-sequence-comments':
$this->sequence['comments'] .= $data;
break;
+ case 'database-sequence-on':
+ $this->sequence['on'] = array('table' => '', 'field' => '');
+ break;
case 'database-sequence-on-table':
$this->sequence['on']['table'] .= $data;
break;
@@ -815,5 +901,3 @@ class MDB2_Schema_Parser extends XML_Parser
}
}
}
-
-?>
diff --git a/3rdparty/MDB2/Schema/Parser2.php b/3rdparty/MDB2/Schema/Parser2.php
index 01318473fdd..b415b4a336e 100644
--- a/3rdparty/MDB2/Schema/Parser2.php
+++ b/3rdparty/MDB2/Schema/Parser2.php
@@ -1,8 +1,6 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
/**
- * PHP versions 4 and 5
- *
- * Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
* Stig. S. Bakken, Lukas Smith, Igor Feghali
* All rights reserved.
*
@@ -39,13 +37,13 @@
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * Author: Igor Feghali <ifeghali@php.net>
+ * PHP version 5
*
* @category Database
* @package MDB2_Schema
* @author Igor Feghali <ifeghali@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: Parser2.php,v 1.12 2008/11/30 03:34:00 clockwerx Exp $
+ * @version SVN: $Id$
* @link http://pear.php.net/packages/MDB2_Schema
*/
@@ -100,8 +98,30 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
var $init = array();
- function __construct($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
- {
+ /**
+ * PHP 5 constructor
+ *
+ * @param array $variables mixed array with user defined schema
+ * variables
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $structure multi dimensional array with
+ * database schema and data
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
+ function __construct($variables, $fail_on_invalid_names = true,
+ $structure = false, $valid_types = array(), $force_defaults = true,
+ $max_identifiers_length = null
+ ) {
// force ISO-8859-1 due to different defaults for PHP4 and PHP5
// todo: this probably needs to be investigated some more and cleaned up
$this->options['encoding'] = 'ISO-8859-1';
@@ -119,15 +139,44 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
$this->variables = $variables;
$this->structure = $structure;
- $this->val =& new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
+ $this->val = new MDB2_Schema_Validate($fail_on_invalid_names, $valid_types, $force_defaults);
parent::XML_Unserializer($this->options);
}
- function MDB2_Schema_Parser2($variables, $fail_on_invalid_names = true, $structure = false, $valid_types = array(), $force_defaults = true)
- {
+ /**
+ * PHP 4 compatible constructor
+ *
+ * @param array $variables mixed array with user defined schema
+ * variables
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $structure multi dimensional array with
+ * database schema and data
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
+ function MDB2_Schema_Parser2($variables, $fail_on_invalid_names = true,
+ $structure = false, $valid_types = array(), $force_defaults = true,
+ $max_identifiers_length = null
+ ) {
$this->__construct($variables, $fail_on_invalid_names, $structure, $valid_types, $force_defaults);
}
+ /**
+ * Main method. Parses XML Schema File.
+ *
+ * @return bool|error object
+ *
+ * @access public
+ */
function parse()
{
$result = $this->unserialize($this->filename, true);
@@ -140,18 +189,33 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
}
}
+ /**
+ * Do the necessary stuff to set the input XML schema file
+ *
+ * @param string $filename full path to schema file
+ *
+ * @return boolean MDB2_OK on success
+ *
+ * @access public
+ */
function setInputFile($filename)
{
$this->filename = $filename;
return MDB2_OK;
}
- function renameKey(&$arr, $oKey, $nKey)
- {
- $arr[$nKey] = &$arr[$oKey];
- unset($arr[$oKey]);
- }
-
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at database level.
+ *
+ * @param array $database multi dimensional array with database definition
+ * and data.
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixDatabaseKeys($database)
{
$this->database_definition = array(
@@ -204,6 +268,18 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at table level.
+ *
+ * @param array $table multi dimensional array with table definition
+ * and data.
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableKeys($table)
{
$this->table = array(
@@ -279,6 +355,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at table field level.
+ *
+ * @param array $field array with table field definition
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableFieldKeys($field)
{
$this->field = array();
@@ -328,6 +415,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at table index level.
+ *
+ * @param array $index array with table index definition
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableIndexKeys($index)
{
$this->index = array(
@@ -389,6 +487,17 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at table constraint level.
+ *
+ * @param array $constraint array with table index definition
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableConstraintKeys($constraint)
{
$this->constraint = array(
@@ -468,6 +577,18 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at table data level.
+ *
+ * @param array $element multi dimensional array with query definition
+ * @param string $type whether its a insert|update|delete query
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableInitializationKeys($element, $type = '')
{
if (!empty($element['select']) && is_array($element['select'])) {
@@ -480,6 +601,43 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
$this->table['initialization'][] = array( 'type' => $type, 'data' => $this->init );
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works deeper at the table initialization level (data). At this
+ * point we are look at one of the below:
+ *
+ * <insert>
+ * {field}+
+ * </insert>
+ *
+ * <select> (this is a select extracted off a insert-select query)
+ * <table/>
+ * {field}+
+ * <where>
+ * {expression}
+ * </where>?
+ * </select>
+ *
+ * <update>
+ * {field}+
+ * <where>
+ * {expression}
+ * </where>?
+ * </update>
+ *
+ * <delete>
+ * <where>
+ * {expression}
+ * </where>
+ * </delete>
+ *
+ * @param array $element multi dimensional array with query definition
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixTableInitializationDataKeys($element)
{
$this->init = array();
@@ -505,6 +663,22 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
}
}
+ /**
+ * Recursively diggs into an "expression" element. According to our
+ * documentation an "expression" element is of the kind:
+ *
+ * <expression>
+ * <null/> or <value/> or <column/> or {function} or {expression}
+ * <operator/>
+ * <null/> or <value/> or <column/> or {function} or {expression}
+ * </expression>
+ *
+ * @param array &$arr reference to current element definition
+ *
+ * @return void
+ *
+ * @access private
+ */
function setExpression(&$arr)
{
$element = each($arr);
@@ -555,6 +729,30 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
}
}
+ /**
+ * Enforce the default values for mandatory keys and ensure everything goes
+ * always in the same order (simulates the behaviour of the original
+ * parser). Works at database sequences level. A "sequence" element looks
+ * like:
+ *
+ * <sequence>
+ * <name/>
+ * <was/>?
+ * <start/>?
+ * <description/>?
+ * <comments/>?
+ * <on>
+ * <table/>
+ * <field/>
+ * </on>?
+ * </sequence>
+ *
+ * @param array $sequence multi dimensional array with sequence definition
+ *
+ * @return bool|error MDB2_OK on success or error object
+ *
+ * @access private
+ */
function fixSequenceKeys($sequence)
{
$this->sequence = array(
@@ -562,7 +760,6 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
'start' => '',
'description' => '',
'comments' => '',
- 'on' => array('table' => '', 'field' => '')
);
if (!empty($sequence['name'])) {
@@ -610,15 +807,23 @@ class MDB2_Schema_Parser2 extends XML_Unserializer
return MDB2_OK;
}
+ /**
+ * Pushes a MDB2_Schema_Error into stack and returns it
+ *
+ * @param string $msg textual message
+ * @param int $ecode MDB2_Schema's error code
+ *
+ * @return object
+ * @access private
+ * @static
+ */
function &raiseError($msg = null, $ecode = MDB2_SCHEMA_ERROR_PARSE)
{
if (is_null($this->error)) {
$error = 'Parser error: '.$msg."\n";
- $this->error =& MDB2_Schema::raiseError($ecode, null, null, $error);
+ $this->error = MDB2_Schema::raiseError($ecode, null, null, $error);
}
return $this->error;
}
}
-
-?>
diff --git a/3rdparty/MDB2/Schema/Reserved/ibase.php b/3rdparty/MDB2/Schema/Reserved/ibase.php
index b208abc83a3..d797822a4b9 100644
--- a/3rdparty/MDB2/Schema/Reserved/ibase.php
+++ b/3rdparty/MDB2/Schema/Reserved/ibase.php
@@ -1,49 +1,51 @@
-<?php
-// {{{ Disclaimer, Licence, copyrights
-// +----------------------------------------------------------------------+
-// | PHP versions 4 and 5 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
-// | Stig. S. Bakken, Lukas Smith |
-// | All rights reserved. |
-// +----------------------------------------------------------------------+
-// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
-// | API as well as database abstraction for PHP applications. |
-// | This LICENSE is in the BSD license style. |
-// | |
-// | Redistribution and use in source and binary forms, with or without |
-// | modification, are permitted provided that the following conditions |
-// | are met: |
-// | |
-// | Redistributions of source code must retain the above copyright |
-// | notice, this list of conditions and the following disclaimer. |
-// | |
-// | Redistributions in binary form must reproduce the above copyright |
-// | notice, this list of conditions and the following disclaimer in the |
-// | documentation and/or other materials provided with the distribution. |
-// | |
-// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
-// | Lukas Smith nor the names of his contributors may be used to endorse |
-// | or promote products derived from this software without specific prior|
-// | written permission. |
-// | |
-// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
-// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
-// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
-// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
-// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
-// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
-// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
-// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
-// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
-// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
-// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
-// | POSSIBILITY OF SUCH DAMAGE. |
-// +----------------------------------------------------------------------+
-// | Author: Lorenzo Alberton <l.alberton@quipo.it> |
-// +----------------------------------------------------------------------+
-//
-// }}}
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author Lorenzo Alberton <l.alberton@quipo.it>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['ibase']
/**
* Has a list of reserved words of Interbase/Firebird
@@ -433,4 +435,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['ibase'] = array(
'ZONE',
);
// }}}
-?> \ No newline at end of file
diff --git a/3rdparty/MDB2/Schema/Reserved/mssql.php b/3rdparty/MDB2/Schema/Reserved/mssql.php
index 74ac6885780..7aa65f426f9 100644
--- a/3rdparty/MDB2/Schema/Reserved/mssql.php
+++ b/3rdparty/MDB2/Schema/Reserved/mssql.php
@@ -1,48 +1,52 @@
-<?php
-// {{{ Disclaimer, Licence, copyrights
-// +----------------------------------------------------------------------+
-// | PHP versions 4 and 5 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
-// | Stig. S. Bakken, Lukas Smith |
-// | All rights reserved. |
-// +----------------------------------------------------------------------+
-// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
-// | API as well as database abstraction for PHP applications. |
-// | This LICENSE is in the BSD license style. |
-// | |
-// | Redistribution and use in source and binary forms, with or without |
-// | modification, are permitted provided that the following conditions |
-// | are met: |
-// | |
-// | Redistributions of source code must retain the above copyright |
-// | notice, this list of conditions and the following disclaimer. |
-// | |
-// | Redistributions in binary form must reproduce the above copyright |
-// | notice, this list of conditions and the following disclaimer in the |
-// | documentation and/or other materials provided with the distribution. |
-// | |
-// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
-// | Lukas Smith nor the names of his contributors may be used to endorse |
-// | or promote products derived from this software without specific prior|
-// | written permission. |
-// | |
-// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
-// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
-// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
-// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
-// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
-// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
-// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
-// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
-// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
-// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
-// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
-// | POSSIBILITY OF SUCH DAMAGE. |
-// +----------------------------------------------------------------------+
-// | Author: David Coallier <davidc@php.net> |
-// +----------------------------------------------------------------------+
-// }}}
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author David Coallier <davidc@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
+
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['mssql']
/**
* Has a list of all the reserved words for mssql.
@@ -254,5 +258,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['mssql'] = array(
'SELECT',
);
//}}}
-
-?>
diff --git a/3rdparty/MDB2/Schema/Reserved/mysql.php b/3rdparty/MDB2/Schema/Reserved/mysql.php
index 4f0575e0bb1..6a4338b261d 100644
--- a/3rdparty/MDB2/Schema/Reserved/mysql.php
+++ b/3rdparty/MDB2/Schema/Reserved/mysql.php
@@ -1,50 +1,52 @@
-<?php
-// {{{ Disclaimer, Licence, copyrights
-// +----------------------------------------------------------------------+
-// | PHP versions 4 and 5 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
-// | Stig. S. Bakken, Lukas Smith |
-// | All rights reserved. |
-// +----------------------------------------------------------------------+
-// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
-// | API as well as database abstraction for PHP applications. |
-// | This LICENSE is in the BSD license style. |
-// | |
-// | Redistribution and use in source and binary forms, with or without |
-// | modification, are permitted provided that the following conditions |
-// | are met: |
-// | |
-// | Redistributions of source code must retain the above copyright |
-// | notice, this list of conditions and the following disclaimer. |
-// | |
-// | Redistributions in binary form must reproduce the above copyright |
-// | notice, this list of conditions and the following disclaimer in the |
-// | documentation and/or other materials provided with the distribution. |
-// | |
-// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
-// | Lukas Smith nor the names of his contributors may be used to endorse |
-// | or promote products derived from this software without specific prior|
-// | written permission. |
-// | |
-// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
-// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
-// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
-// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
-// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
-// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
-// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
-// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
-// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
-// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
-// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
-// | POSSIBILITY OF SUCH DAMAGE. |
-// +----------------------------------------------------------------------+
-// | Author: David Coallier <davidc@php.net> |
-// +----------------------------------------------------------------------+
-//
-// $Id: mysql.php,v 1.3 2006/03/01 12:16:40 lsmith Exp $
-// }}}
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author David Coallier <davidc@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
+
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['mysql']
/**
* Has a list of reserved words of mysql
@@ -281,4 +283,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['mysql'] = array(
'ZEROFILL',
);
// }}}
-?>
diff --git a/3rdparty/MDB2/Schema/Reserved/oci8.php b/3rdparty/MDB2/Schema/Reserved/oci8.php
index 57fe12ddcab..3cc898e1d68 100644
--- a/3rdparty/MDB2/Schema/Reserved/oci8.php
+++ b/3rdparty/MDB2/Schema/Reserved/oci8.php
@@ -1,48 +1,52 @@
-<?php
-// {{{ Disclaimer, Licence, copyrights
-// +----------------------------------------------------------------------+
-// | PHP versions 4 and 5 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
-// | Stig. S. Bakken, Lukas Smith |
-// | All rights reserved. |
-// +----------------------------------------------------------------------+
-// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
-// | API as well as database abstraction for PHP applications. |
-// | This LICENSE is in the BSD license style. |
-// | |
-// | Redistribution and use in source and binary forms, with or without |
-// | modification, are permitted provided that the following conditions |
-// | are met: |
-// | |
-// | Redistributions of source code must retain the above copyright |
-// | notice, this list of conditions and the following disclaimer. |
-// | |
-// | Redistributions in binary form must reproduce the above copyright |
-// | notice, this list of conditions and the following disclaimer in the |
-// | documentation and/or other materials provided with the distribution. |
-// | |
-// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
-// | Lukas Smith nor the names of his contributors may be used to endorse |
-// | or promote products derived from this software without specific prior|
-// | written permission. |
-// | |
-// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
-// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
-// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
-// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
-// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
-// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
-// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
-// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
-// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
-// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
-// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
-// | POSSIBILITY OF SUCH DAMAGE. |
-// +----------------------------------------------------------------------+
-// | Author: David Coallier <davidc@php.net> |
-// +----------------------------------------------------------------------+
-// }}}
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author David Coallier <davidc@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
+
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['oci8']
/**
* Has a list of all the reserved words for oracle.
@@ -167,5 +171,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['oci8'] = array(
'WITH',
);
// }}}
-
-?>
diff --git a/3rdparty/MDB2/Schema/Reserved/pgsql.php b/3rdparty/MDB2/Schema/Reserved/pgsql.php
index d358e9c12f0..84537685e0f 100644
--- a/3rdparty/MDB2/Schema/Reserved/pgsql.php
+++ b/3rdparty/MDB2/Schema/Reserved/pgsql.php
@@ -1,49 +1,52 @@
-<?php
-// {{{ Disclaimer, Licence, copyrights
-// +----------------------------------------------------------------------+
-// | PHP versions 4 and 5 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1998-2006 Manuel Lemos, Tomas V.V.Cox, |
-// | Stig. S. Bakken, Lukas Smith |
-// | All rights reserved. |
-// +----------------------------------------------------------------------+
-// | MDB2 is a merge of PEAR DB and Metabases that provides a unified DB |
-// | API as well as database abstraction for PHP applications. |
-// | This LICENSE is in the BSD license style. |
-// | |
-// | Redistribution and use in source and binary forms, with or without |
-// | modification, are permitted provided that the following conditions |
-// | are met: |
-// | |
-// | Redistributions of source code must retain the above copyright |
-// | notice, this list of conditions and the following disclaimer. |
-// | |
-// | Redistributions in binary form must reproduce the above copyright |
-// | notice, this list of conditions and the following disclaimer in the |
-// | documentation and/or other materials provided with the distribution. |
-// | |
-// | Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken, |
-// | Lukas Smith nor the names of his contributors may be used to endorse |
-// | or promote products derived from this software without specific prior|
-// | written permission. |
-// | |
-// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
-// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
-// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
-// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
-// | REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
-// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
-// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS|
-// | OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
-// | AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
-// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY|
-// | WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
-// | POSSIBILITY OF SUCH DAMAGE. |
-// +----------------------------------------------------------------------+
-// | Author: Marcelo Santos Araujo <msaraujo@php.net> |
-// +----------------------------------------------------------------------+
-//
-// }}}
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author Marcelo Santos Araujo <msaraujo@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
+
// {{{ $GLOBALS['_MDB2_Schema_Reserved']['pgsql']
/**
* Has a list of reserved words of pgsql
@@ -143,5 +146,3 @@ $GLOBALS['_MDB2_Schema_Reserved']['pgsql'] = array(
'WHERE'
);
// }}}
-?>
-
diff --git a/3rdparty/MDB2/Schema/Tool.php b/3rdparty/MDB2/Schema/Tool.php
index 9689a0f6d73..3210c9173eb 100644
--- a/3rdparty/MDB2/Schema/Tool.php
+++ b/3rdparty/MDB2/Schema/Tool.php
@@ -1,8 +1,6 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
/**
- * PHP versions 4 and 5
- *
- * Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
* Stig. S. Bakken, Lukas Smith, Igor Feghali
* All rights reserved.
*
@@ -39,14 +37,13 @@
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * Author: Christian Weiske <cweiske@php.net>
- * $Id: Tool.php,v 1.6 2008/12/13 00:26:07 clockwerx Exp $
+ * PHP version 5
*
* @category Database
* @package MDB2_Schema
* @author Christian Weiske <cweiske@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: Tool.php,v 1.6 2008/12/13 00:26:07 clockwerx Exp $
+ * @version SVN: $Id$
* @link http://pear.php.net/packages/MDB2_Schema
*/
@@ -152,7 +149,9 @@ class MDB2_Schema_Tool
case '--init':
return 'init';
default:
- throw new MDB2_Schema_Tool_ParameterException("Unknown mode \"$arg\"");
+ throw new MDB2_Schema_Tool_ParameterException(
+ "Unknown mode \"$arg\""
+ );
}
}//protected function getAction(&$args)
@@ -179,7 +178,8 @@ class MDB2_Schema_Tool
*/
protected function doHelp()
{
- self::toStdErr(<<<EOH
+ self::toStdErr(
+<<<EOH
Usage: mdb2_schematool mode parameters
Works with database schemas
@@ -205,7 +205,8 @@ EOH
*/
protected function doHelpDump()
{
- self::toStdErr( <<<EOH
+ self::toStdErr(
+<<<EOH
Usage: mdb2_schematool dump [all|data|schema] [-p] DSN
Dumps a database schema to stdout
@@ -216,7 +217,8 @@ DSN: Data source name in the form of
driver://user:password@host/database
User and password may be omitted.
-Using -p reads password from stdin which is more secure than passing it in the parameter.
+Using -p reads password from stdin which is more secure than passing it in the
+parameter.
EOH
);
@@ -231,7 +233,8 @@ EOH
*/
protected function doHelpInit()
{
- self::toStdErr( <<<EOH
+ self::toStdErr(
+<<<EOH
Usage: mdb2_schematool init source [-p] destination
Initializes a database with data
@@ -244,7 +247,8 @@ DSN: Data source name in the form of
driver://user:password@host/database
User and password may be omitted.
-Using -p reads password from stdin which is more secure than passing it in the parameter.
+Using -p reads password from stdin which is more secure than passing it in the
+parameter.
EOH
);
@@ -259,7 +263,8 @@ EOH
*/
protected function doHelpLoad()
{
- self::toStdErr( <<<EOH
+ self::toStdErr(
+<<<EOH
Usage: mdb2_schematool load [-p] source [-p] destination
Loads a database schema from source to destination
@@ -272,7 +277,8 @@ DSN: Data source name in the form of
driver://user:password@host/database
User and password may be omitted.
-Using -p reads password from stdin which is more secure than passing it in the parameter.
+Using -p reads password from stdin which is more secure than passing it in the
+parameter.
EOH
);
@@ -334,7 +340,9 @@ EOH
protected function getFileOrDsn(&$args)
{
if (count($args) == 0) {
- throw new MDB2_Schema_Tool_ParameterException('File or DSN expected');
+ throw new MDB2_Schema_Tool_ParameterException(
+ 'File or DSN expected'
+ );
}
$arg = array_shift($args);
@@ -450,7 +458,8 @@ EOH
list($type, $dsn) = $this->getFileOrDsn($args);
if ($type == 'file') {
throw new MDB2_Schema_Tool_ParameterException(
- 'Dumping a schema file as a schema file does not make much sense'
+ 'Dumping a schema file as a schema file does not make much ' .
+ 'sense'
);
}
@@ -503,8 +512,14 @@ EOH
$definition = $schemaDest->parseDatabaseDefinitionFile($dsnSource);
$where = 'loading schema file';
} else {
- $schemaSource = MDB2_Schema::factory($dsnSource, $this->getSchemaOptions());
- $this->throwExceptionOnError($schemaSource, 'connecting to source database');
+ $schemaSource = MDB2_Schema::factory(
+ $dsnSource,
+ $this->getSchemaOptions()
+ );
+ $this->throwExceptionOnError(
+ $schemaSource,
+ 'connecting to source database'
+ );
$definition = $schemaSource->getDefinitionFromDatabase();
$where = 'loading definition from database';
@@ -514,7 +529,11 @@ EOH
//create destination database from definition
$simulate = false;
- $op = $schemaDest->createDatabase($definition, array(), $simulate);
+ $op = $schemaDest->createDatabase(
+ $definition,
+ array(),
+ $simulate
+ );
$this->throwExceptionOnError($op, 'creating the database');
}//protected function doLoad($args)
@@ -545,10 +564,16 @@ EOH
}
$schemaDest = MDB2_Schema::factory($dsnDest, $this->getSchemaOptions());
- $this->throwExceptionOnError($schemaDest, 'connecting to destination database');
+ $this->throwExceptionOnError(
+ $schemaDest,
+ 'connecting to destination database'
+ );
$definition = $schemaDest->getDefinitionFromDatabase();
- $this->throwExceptionOnError($definition, 'loading definition from database');
+ $this->throwExceptionOnError(
+ $definition,
+ 'loading definition from database'
+ );
$op = $schemaDest->writeInitialization($dsnSource, $definition);
$this->throwExceptionOnError($op, 'initializing database');
@@ -556,5 +581,3 @@ EOH
}//class MDB2_Schema_Tool
-
-?>
diff --git a/3rdparty/MDB2/Schema/Tool/ParameterException.php b/3rdparty/MDB2/Schema/Tool/ParameterException.php
index fab1e03e250..92bea693917 100644
--- a/3rdparty/MDB2/Schema/Tool/ParameterException.php
+++ b/3rdparty/MDB2/Schema/Tool/ParameterException.php
@@ -1,6 +1,61 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
+/**
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
+ * Stig. S. Bakken, Lukas Smith, Igor Feghali
+ * All rights reserved.
+ *
+ * MDB2_Schema enables users to maintain RDBMS independant schema files
+ * in XML that can be used to manipulate both data and database schemas
+ * This LICENSE is in the BSD license style.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Manuel Lemos, Tomas V.V.Cox, Stig. S. Bakken,
+ * Lukas Smith, Igor Feghali nor the names of his contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
+ * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * PHP version 5
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author Christian Weiske <cweiske@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @version SVN: $Id$
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
+/**
+ * To be implemented yet
+ *
+ * @category Database
+ * @package MDB2_Schema
+ * @author Christian Weiske <cweiske@php.net>
+ * @license BSD http://www.opensource.org/licenses/bsd-license.php
+ * @link http://pear.php.net/packages/MDB2_Schema
+ */
class MDB2_Schema_Tool_ParameterException extends Exception
-{}
-
-?> \ No newline at end of file
+{
+}
diff --git a/3rdparty/MDB2/Schema/Validate.php b/3rdparty/MDB2/Schema/Validate.php
index 21be024ce9f..4cff175576f 100644
--- a/3rdparty/MDB2/Schema/Validate.php
+++ b/3rdparty/MDB2/Schema/Validate.php
@@ -1,8 +1,6 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
/**
- * PHP versions 4 and 5
- *
- * Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
* Stig. S. Bakken, Lukas Smith, Igor Feghali
* All rights reserved.
*
@@ -39,15 +37,14 @@
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * Author: Christian Dickmann <dickmann@php.net>
- * Author: Igor Feghali <ifeghali@php.net>
+ * PHP version 5
*
* @category Database
* @package MDB2_Schema
* @author Christian Dickmann <dickmann@php.net>
* @author Igor Feghali <ifeghali@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: Validate.php,v 1.42 2008/11/30 03:34:00 clockwerx Exp $
+ * @version SVN: $Id$
* @link http://pear.php.net/packages/MDB2_Schema
*/
@@ -70,11 +67,30 @@ class MDB2_Schema_Validate
var $force_defaults = true;
+ var $max_identifiers_length = null;
+
// }}}
// {{{ constructor
- function __construct($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
- {
+ /**
+ * PHP 5 constructor
+ *
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
+ function __construct($fail_on_invalid_names = true, $valid_types = array(),
+ $force_defaults = true, $max_identifiers_length = null
+ ) {
if (empty($GLOBALS['_MDB2_Schema_Reserved'])) {
$GLOBALS['_MDB2_Schema_Reserved'] = array();
}
@@ -87,21 +103,49 @@ class MDB2_Schema_Validate
} else {
$this->fail_on_invalid_names = array();
}
- $this->valid_types = $valid_types;
- $this->force_defaults = $force_defaults;
+ $this->valid_types = $valid_types;
+ $this->force_defaults = $force_defaults;
+ $this->max_identifiers_length = $max_identifiers_length;
}
- function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(), $force_defaults = true)
- {
+ /**
+ * PHP 4 compatible constructor
+ *
+ * @param bool $fail_on_invalid_names array with reserved words per RDBMS
+ * @param array $valid_types information of all valid fields
+ * types
+ * @param bool $force_defaults if true sets a default value to
+ * field when not explicit
+ * @param int $max_identifiers_length maximum allowed size for entities
+ * name
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
+ function MDB2_Schema_Validate($fail_on_invalid_names = true, $valid_types = array(),
+ $force_defaults = true, $max_identifiers_length = null
+ ) {
$this->__construct($fail_on_invalid_names, $valid_types, $force_defaults);
}
// }}}
// {{{ raiseError()
+ /**
+ * Pushes a MDB2_Schema_Error into stack and returns it
+ *
+ * @param int $ecode MDB2_Schema's error code
+ * @param string $msg textual message
+ *
+ * @return object
+ * @access private
+ * @static
+ */
function &raiseError($ecode, $msg = null)
{
- $error =& MDB2_Schema::raiseError($ecode, null, null, $msg);
+ $error = MDB2_Schema::raiseError($ecode, null, null, $msg);
return $error;
}
@@ -176,27 +220,18 @@ class MDB2_Schema_Validate
*/
function validateTable($tables, &$table, $table_name)
{
- /* Have we got a name? */
- if (!$table_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'a table has to have a name');
- }
-
/* Table name duplicated? */
if (is_array($tables) && 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);
- foreach ($this->fail_on_invalid_names as $rdbms) {
- if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'table name "'.$table_name.'" is a reserved word in: '.$rdbms);
- }
- }
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($table_name, 'table');
+ if (PEAR::isError($result)) {
+ return $result;
}
/* Was */
@@ -289,10 +324,12 @@ class MDB2_Schema_Validate
*/
function validateField($fields, &$field, $field_name)
{
- /* Have we got a name? */
- if (!$field_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'field name missing');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($field_name, 'field');
+ if (PEAR::isError($result)) {
+ return $result;
}
/* Field name duplicated? */
@@ -301,17 +338,6 @@ class MDB2_Schema_Validate
'field "'.$field_name.'" already exists');
}
- /* Field name reserverd? */
- if (is_array($this->fail_on_invalid_names)) {
- $name = strtoupper($field_name);
- foreach ($this->fail_on_invalid_names as $rdbms) {
- if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'field name "'.$field_name.'" is a reserved word in: '.$rdbms);
- }
- }
- }
-
/* Type check */
if (empty($field['type'])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
@@ -422,10 +448,14 @@ class MDB2_Schema_Validate
*/
function validateIndex($table_indexes, &$index, $index_name)
{
- if (!$index_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'an index has to have a name');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($index_name, 'index');
+ if (PEAR::isError($result)) {
+ return $result;
}
+
if (is_array($table_indexes) && isset($table_indexes[$index_name])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
'index "'.$index_name.'" already exists');
@@ -470,14 +500,18 @@ class MDB2_Schema_Validate
*/
function validateIndexField($index_fields, &$field, $field_name)
{
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($field_name, 'index field');
+ if (PEAR::isError($result)) {
+ return $result;
+ }
+
if (is_array($index_fields) && isset($index_fields[$field_name])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
'index field "'.$field_name.'" already exists');
}
- if (!$field_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'the index-field-name is required');
- }
if (empty($field['sorting'])) {
$field['sorting'] = 'ascending';
} elseif ($field['sorting'] !== 'ascending' && $field['sorting'] !== 'descending') {
@@ -506,10 +540,14 @@ class MDB2_Schema_Validate
*/
function validateConstraint($table_constraints, &$constraint, $constraint_name)
{
- if (!$constraint_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'a foreign key has to have a name');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($constraint_name, 'foreign key');
+ if (PEAR::isError($result)) {
+ return $result;
}
+
if (is_array($table_constraints) && isset($table_constraints[$constraint_name])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
'foreign key "'.$constraint_name.'" already exists');
@@ -555,10 +593,14 @@ class MDB2_Schema_Validate
*/
function validateConstraintField($constraint_fields, $field_name)
{
- if (!$field_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'empty value for foreign-field');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($field_name, 'foreign key field');
+ if (PEAR::isError($result)) {
+ return $result;
}
+
if (is_array($constraint_fields) && isset($constraint_fields[$field_name])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
'foreign field "'.$field_name.'" already exists');
@@ -582,10 +624,14 @@ class MDB2_Schema_Validate
*/
function validateConstraintReferencedField($referenced_fields, $field_name)
{
- if (!$field_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'empty value for referenced foreign-field');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($field_name, 'referenced foreign field');
+ if (PEAR::isError($result)) {
+ return $result;
}
+
if (is_array($referenced_fields) && isset($referenced_fields[$field_name])) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
'foreign field "'.$field_name.'" already referenced');
@@ -612,9 +658,12 @@ class MDB2_Schema_Validate
*/
function validateSequence($sequences, &$sequence, $sequence_name)
{
- if (!$sequence_name) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'a sequence has to have a name');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($sequence_name, 'sequence');
+ if (PEAR::isError($result)) {
+ return $result;
}
if (is_array($sequences) && isset($sequences[$sequence_name])) {
@@ -661,21 +710,17 @@ class MDB2_Schema_Validate
*/
function validateDatabase(&$database)
{
- /* Have we got a name? */
- if (!is_array($database) || !isset($database['name']) || !$database['name']) {
+ if (!is_array($database)) {
return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'a database has to have a name');
+ 'something wrong went with database definition');
}
- /* Database name reserved? */
- if (is_array($this->fail_on_invalid_names)) {
- $name = strtoupper($database['name']);
- foreach ($this->fail_on_invalid_names as $rdbms) {
- if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'database name "'.$database['name'].'" is a reserved word in: '.$rdbms);
- }
- }
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($database['name'], 'database');
+ if (PEAR::isError($result)) {
+ return $result;
}
/* Create */
@@ -798,9 +843,12 @@ class MDB2_Schema_Validate
*/
function validateDataField($table_fields, $instruction_fields, &$field)
{
- if (!$field['name']) {
- return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
- 'field-name has to be specified');
+ /**
+ * Valid name ?
+ */
+ $result = $this->validateIdentifier($field['name'], 'field');
+ if (PEAR::isError($result)) {
+ return $result;
}
if (is_array($instruction_fields) && isset($instruction_fields[$field['name']])) {
@@ -917,6 +965,62 @@ class MDB2_Schema_Validate
}
return MDB2_OK;
}
-}
-?>
+ // }}}
+ // {{{ validateIdentifier()
+
+ /**
+ * Checks whether a given identifier is valid for current driver.
+ *
+ * @param string $id identifier to check
+ * @param string $type whether identifier represents a table name, index, etc.
+ *
+ * @return bool|error object
+ *
+ * @access public
+ */
+ function validateIdentifier($id, $type)
+ {
+ $max_length = $this->max_identifiers_length;
+ $cur_length = strlen($id);
+
+ /**
+ * Have we got a name?
+ */
+ if (!$id) {
+ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
+ "a $type has to have a name");
+ }
+
+ /**
+ * Supported length ?
+ */
+ if ($max_length !== null
+ && $cur_length > $max_length
+ ) {
+ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
+ "$type name '$id' is too long for current driver");
+ } elseif ($cur_length > 30) {
+ // FIXME: find a way to issue a warning in MDB2_Schema object
+ /* $this->warnings[] = "$type name '$id' might not be
+ portable to other drivers"; */
+ }
+
+ /**
+ * Reserved ?
+ */
+ if (is_array($this->fail_on_invalid_names)) {
+ $name = strtoupper($id);
+ foreach ($this->fail_on_invalid_names as $rdbms) {
+ if (in_array($name, $GLOBALS['_MDB2_Schema_Reserved'][$rdbms])) {
+ return $this->raiseError(MDB2_SCHEMA_ERROR_VALIDATE,
+ "$type name '$id' is a reserved word in: $rdbms");
+ }
+ }
+ }
+
+ return MDB2_OK;
+ }
+
+ // }}}
+}
diff --git a/3rdparty/MDB2/Schema/Writer.php b/3rdparty/MDB2/Schema/Writer.php
index 5ae4918dc1d..70a03168de6 100644
--- a/3rdparty/MDB2/Schema/Writer.php
+++ b/3rdparty/MDB2/Schema/Writer.php
@@ -1,8 +1,6 @@
-<?php
+<?php /* vim: se et ts=4 sw=4 sts=4 fdm=marker tw=80: */
/**
- * PHP versions 4 and 5
- *
- * Copyright (c) 1998-2008 Manuel Lemos, Tomas V.V.Cox,
+ * Copyright (c) 1998-2010 Manuel Lemos, Tomas V.V.Cox,
* Stig. S. Bakken, Lukas Smith, Igor Feghali
* All rights reserved.
*
@@ -39,15 +37,14 @@
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * Author: Lukas Smith <smith@pooteeweet.org>
- * Author: Igor Feghali <ifeghali@php.net>
+ * PHP version 5
*
* @category Database
* @package MDB2_Schema
* @author Lukas Smith <smith@pooteeweet.org>
* @author Igor Feghali <ifeghali@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: Writer.php,v 1.40 2008/11/30 03:34:00 clockwerx Exp $
+ * @version SVN: $Id$
* @link http://pear.php.net/packages/MDB2_Schema
*/
@@ -69,11 +66,33 @@ class MDB2_Schema_Writer
// }}}
// {{{ constructor
+ /**
+ * PHP 5 constructor
+ *
+ * @param array $valid_types information of all valid fields
+ * types
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
function __construct($valid_types = array())
{
$this->valid_types = $valid_types;
}
+ /**
+ * PHP 4 compatible constructor
+ *
+ * @param array $valid_types information of all valid fields
+ * types
+ *
+ * @return void
+ *
+ * @access public
+ * @static
+ */
function MDB2_Schema_Writer($valid_types = array())
{
$this->__construct($valid_types);
@@ -87,15 +106,18 @@ class MDB2_Schema_Writer
* callbacks etc. Basically a wrapper for PEAR::raiseError
* without the message string.
*
- * @param int|PEAR_Error $code integer error code or and PEAR_Error instance
- * @param int $mode error mode, see PEAR_Error docs
- * error level (E_USER_NOTICE etc). If error mode is
- * PEAR_ERROR_CALLBACK, this is the callback function,
- * either as a function name, or as an array of an
- * object and method name. For other error modes this
- * parameter is ignored.
- * @param string $options Extra debug information. Defaults to the last
- * query and native error code.
+ * @param int|PEAR_Error $code integer error code or and PEAR_Error
+ * instance
+ * @param int $mode error mode, see PEAR_Error docs error
+ * level (E_USER_NOTICE etc). If error mode
+ * is PEAR_ERROR_CALLBACK, this is the
+ * callback function, either as a function
+ * name, or as an array of an object and
+ * method name. For other error modes this
+ * parameter is ignored.
+ * @param string $options Extra debug information. Defaults to the
+ * last query and native error code.
+ * @param string $userinfo User-friendly error message
*
* @return object a PEAR error object
* @access public
@@ -103,7 +125,7 @@ class MDB2_Schema_Writer
*/
function &raiseError($code = null, $mode = null, $options = null, $userinfo = null)
{
- $error =& MDB2_Schema::raiseError($code, $mode, $options, $userinfo);
+ $error = MDB2_Schema::raiseError($code, $mode, $options, $userinfo);
return $error;
}
@@ -578,4 +600,3 @@ class MDB2_Schema_Writer
// }}}
}
-?>