From c0ee7a47e4327b69c59d0c4135152b4db3111d55 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 17 Apr 2011 10:36:32 +0200 Subject: [PATCH] fix more strict error is mdb2 --- 3dparty/MDB2.php | 9 ++-- 3dparty/MDB2/Driver/Manager/Common.php | 58 +++++++++++++------------- 3dparty/MDB2/Driver/Manager/mysql.php | 52 +++++++++++------------ 3dparty/MDB2/Driver/Manager/sqlite.php | 56 ++++++++++++------------- 3dparty/MDB2/Driver/Reverse/Common.php | 12 +++--- 3dparty/MDB2/Driver/Reverse/mysql.php | 12 +++--- 3dparty/MDB2/Driver/Reverse/sqlite.php | 28 ++++++------- 3dparty/MDB2/Schema.php | 10 ++--- 8 files changed, 119 insertions(+), 118 deletions(-) diff --git a/3dparty/MDB2.php b/3dparty/MDB2.php index 8c4fe0999cd..19d6b8c4284 100644 --- a/3dparty/MDB2.php +++ b/3dparty/MDB2.php @@ -637,7 +637,7 @@ class MDB2 * * @access public */ - function isError($data, $code = null) + static function isError($data, $code = null) { if (is_a($data, 'MDB2_Error')) { if (is_null($code)) { @@ -664,7 +664,7 @@ class MDB2 * * @access public */ - function isConnection($value) + static function isConnection($value) { return is_a($value, 'MDB2_Driver_Common'); } @@ -681,7 +681,7 @@ class MDB2 * * @access public */ - function isResult($value) + static function isResult($value) { return is_a($value, 'MDB2_Result'); } @@ -715,7 +715,7 @@ class MDB2 * * @access public */ - function isStatement($value) + static function isStatement($value) { return is_a($value, 'MDB2_Statement_Common'); } @@ -1494,6 +1494,7 @@ class MDB2_Driver_Common extends PEAR if (!is_null($native_msg) && $native_msg !== '') { $userinfo.= "[Native message: ". strip_tags($native_msg) ."]\n"; } + echo $userinfo; if (!is_null($method)) { $userinfo = $method.': '.$userinfo; } diff --git a/3dparty/MDB2/Driver/Manager/Common.php b/3dparty/MDB2/Driver/Manager/Common.php index d7154d4eac0..9e16749bffc 100644 --- a/3dparty/MDB2/Driver/Manager/Common.php +++ b/3dparty/MDB2/Driver/Manager/Common.php @@ -108,7 +108,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function getFieldDeclarationList($fields) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -140,7 +140,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function _fixSequenceName($sqn, $check = false) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -168,7 +168,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function _fixIndexName($idx) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -195,7 +195,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function createDatabase($database, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -218,7 +218,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function alterDatabase($database, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -239,7 +239,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function dropDatabase($database) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -263,7 +263,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function _getCreateTableQuery($name, $fields, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -356,7 +356,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common if (PEAR::isError($query)) { return $query; } - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -379,7 +379,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function dropTable($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -401,7 +401,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function truncateTable($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -429,7 +429,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function vacuum($table = null, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -533,7 +533,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function alterTable($name, $changes, $check) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -553,7 +553,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listDatabases() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -573,7 +573,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listUsers() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -596,7 +596,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listViews($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -617,7 +617,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTableViews($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -638,7 +638,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTableTriggers($table = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -658,7 +658,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listFunctions() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -681,7 +681,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTables($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -702,7 +702,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTableFields($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -748,7 +748,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function createIndex($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -777,7 +777,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function dropIndex($table, $name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -798,7 +798,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTableIndexes($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -867,7 +867,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function createConstraint($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -912,7 +912,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function dropConstraint($table, $name, $primary = false) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -934,7 +934,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listTableConstraints($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -956,7 +956,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function createSequence($seq_name, $start = 1) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -977,7 +977,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function dropSequence($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1000,7 +1000,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common */ function listSequences($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Driver/Manager/mysql.php b/3dparty/MDB2/Driver/Manager/mysql.php index 29d644a957a..099ed48a84f 100644 --- a/3dparty/MDB2/Driver/Manager/mysql.php +++ b/3dparty/MDB2/Driver/Manager/mysql.php @@ -71,7 +71,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function createDatabase($name, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -101,7 +101,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function alterDatabase($name, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -128,7 +128,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function dropDatabase($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -204,7 +204,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function createTable($name, $fields, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -285,7 +285,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function dropTable($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -321,7 +321,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function truncateTable($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -349,7 +349,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function vacuum($table = null, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -474,7 +474,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function alterTable($name, $changes, $check) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -575,7 +575,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listDatabases() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -601,7 +601,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listUsers() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -620,7 +620,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listFunctions() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -653,7 +653,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listTableTriggers($table = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -685,7 +685,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listTables($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -725,7 +725,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listViews($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -759,7 +759,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listTableFields($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -815,7 +815,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function createIndex($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -848,7 +848,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function dropIndex($table, $name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -870,7 +870,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listTableIndexes($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -934,7 +934,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function createConstraint($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1008,7 +1008,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function dropConstraint($table, $name, $primary = false) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1058,7 +1058,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function _createFKTriggers($table, $foreign_keys) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1198,7 +1198,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function _dropFKTriggers($table, $fkname, $referenced_table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1232,7 +1232,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listTableConstraints($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1307,7 +1307,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function createSequence($seq_name, $start = 1, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1380,7 +1380,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function dropSequence($seq_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1401,7 +1401,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common */ function listSequences($database = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Driver/Manager/sqlite.php b/3dparty/MDB2/Driver/Manager/sqlite.php index e985298c2c3..3a5d266280e 100644 --- a/3dparty/MDB2/Driver/Manager/sqlite.php +++ b/3dparty/MDB2/Driver/Manager/sqlite.php @@ -71,7 +71,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function createDatabase($name, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -107,7 +107,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function dropDatabase($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -174,7 +174,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function _getCreateTableQuery($name, $fields, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -236,7 +236,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common } // create triggers to enforce FOREIGN KEY constraints if (!empty($options['foreign_keys'])) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -384,7 +384,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function dropTable($name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -427,7 +427,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function vacuum($table = null, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -534,7 +534,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function alterTable($name, $changes, $check, $options = array()) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -687,7 +687,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common $query = 'INSERT INTO '.$db->quoteIdentifier($name_new, true); $query.= '('.implode(', ', array_slice(array_keys($fields), 0, count($select_fields))).')'; $query.=' VALUES (?'.str_repeat(', ?', (count($select_fields) - 1)).')'; - $stmt =& $db->prepare($query, null, MDB2_PREPARE_MANIP); + $stmt =$db->prepare($query, null, MDB2_PREPARE_MANIP); if (PEAR::isError($stmt)) { return $stmt; } @@ -712,7 +712,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listDatabases() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -732,7 +732,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listUsers() { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -750,9 +750,9 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common * @return mixed array of view names on success, a MDB2 error on failure * @access public */ - function listViews() + function listViews($dummy=null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -780,7 +780,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listTableViews($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -814,9 +814,9 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common * @return mixed array of table names on success, a MDB2 error on failure * @access public */ - function listTables() + function listTables($dummy=null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -850,7 +850,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listTableFields($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -898,7 +898,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listTableTriggers($table = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -958,7 +958,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function createIndex($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -998,7 +998,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function dropIndex($table, $name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1019,7 +1019,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listTableIndexes($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1080,7 +1080,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function createConstraint($table, $name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1133,7 +1133,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common return $this->alterTable($table, array(), false, array('primary' => null)); } - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1170,7 +1170,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function _dropFKTriggers($table, $fkname, $referenced_table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1204,7 +1204,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function listTableConstraints($table) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1274,7 +1274,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function createSequence($seq_name, $start = 1) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1315,7 +1315,7 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common */ function dropSequence($seq_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -1333,9 +1333,9 @@ class MDB2_Driver_Manager_sqlite extends MDB2_Driver_Manager_Common * @return mixed array of sequence names on success, a MDB2 error on failure * @access public */ - function listSequences() + function listSequences($dummy=null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Driver/Reverse/Common.php b/3dparty/MDB2/Driver/Reverse/Common.php index 4a411fea6d2..c78d84f760a 100644 --- a/3dparty/MDB2/Driver/Reverse/Common.php +++ b/3dparty/MDB2/Driver/Reverse/Common.php @@ -107,7 +107,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function getTableFieldDefinition($table, $field) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -141,7 +141,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function getTableIndexDefinition($table, $index) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -193,7 +193,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function getTableConstraintDefinition($table, $index) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -220,7 +220,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function getSequenceDefinition($sequence) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -273,7 +273,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function getTriggerDefinition($trigger) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -407,7 +407,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common */ function tableInfo($result, $mode = null) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Driver/Reverse/mysql.php b/3dparty/MDB2/Driver/Reverse/mysql.php index 856d2427ab4..6e366c22a5e 100644 --- a/3dparty/MDB2/Driver/Reverse/mysql.php +++ b/3dparty/MDB2/Driver/Reverse/mysql.php @@ -69,7 +69,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common */ function getTableFieldDefinition($table_name, $field_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -181,7 +181,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common */ function getTableIndexDefinition($table_name, $index_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -256,7 +256,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common */ function getTableConstraintDefinition($table_name, $constraint_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -356,7 +356,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common */ function _getTableFKConstraintDefinition($table, $constraint_name, $definition) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -424,7 +424,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common */ function getTriggerDefinition($trigger) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -476,7 +476,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common return parent::tableInfo($result, $mode); } - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Driver/Reverse/sqlite.php b/3dparty/MDB2/Driver/Reverse/sqlite.php index b83544835fe..60c686c418a 100644 --- a/3dparty/MDB2/Driver/Reverse/sqlite.php +++ b/3dparty/MDB2/Driver/Reverse/sqlite.php @@ -63,7 +63,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common * @access private */ function _removeComments($sql) { - $lines = split("\n", $sql); + $lines = explode("\n", $sql); foreach ($lines as $k => $line) { $pieces = explode('--', $line); if (count($pieces) > 1 && (substr_count($pieces[0], '\'') % 2) == 0) { @@ -78,7 +78,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common */ function _getTableColumns($sql) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -88,7 +88,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common // replace the decimal length-places-separator with a colon $column_def = preg_replace('/(\d),(\d)/', '\1:\2', $column_def); $column_def = $this->_removeComments($column_def); - $column_sql = split(',', $column_def); + $column_sql = explode(',', $column_def); $columns = array(); $count = count($column_sql); if ($count == 0) { @@ -156,7 +156,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common */ function getTableFieldDefinition($table_name, $field_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -258,7 +258,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common */ function getTableIndexDefinition($table_name, $index_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -300,7 +300,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common $start_pos = strpos($sql, '('); $end_pos = strrpos($sql, ')'); $column_names = substr($sql, $start_pos+1, $end_pos-$start_pos-1); - $column_names = split(',', $column_names); + $column_names = explode(',', $column_names); if (preg_match("/^create unique/", $sql)) { return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null, @@ -341,7 +341,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common */ function getTableConstraintDefinition($table_name, $constraint_name) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -408,7 +408,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common if (preg_match("/\bPRIMARY\s+KEY\b\s*\(([^)]+)/i", $sql, $tmp)) { $definition['primary'] = true; $definition['fields'] = array(); - $column_names = split(',', $tmp[1]); + $column_names = explode(',', $tmp[1]); $colpos = 1; foreach ($column_names as $column_name) { $definition['fields'][trim($column_name)] = array( @@ -420,7 +420,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common if (preg_match("/\"([^\"]+)\"[^\,\"]+\bPRIMARY\s+KEY\b[^\,\)]*/i", $sql, $tmp)) { $definition['primary'] = true; $definition['fields'] = array(); - $column_names = split(',', $tmp[1]); + $column_names = explode(',', $tmp[1]); $colpos = 1; foreach ($column_names as $column_name) { $definition['fields'][trim($column_name)] = array( @@ -450,14 +450,14 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common $definition['onupdate'] = 'NO ACTION'; $definition['ondelete'] = 'NO ACTION'; $definition['references']['table'] = $tmp[2]; - $column_names = split(',', $tmp[1]); + $column_names = explode(',', $tmp[1]); $colpos = 1; foreach ($column_names as $column_name) { $definition['fields'][trim($column_name)] = array( 'position' => $colpos++ ); } - $referenced_cols = split(',', $tmp[3]); + $referenced_cols = explode(',', $tmp[3]); $colpos = 1; foreach ($referenced_cols as $column_name) { $definition['references']['fields'][trim($column_name)] = array( @@ -487,7 +487,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common $start_pos = strpos($sql, '('); $end_pos = strrpos($sql, ')'); $column_names = substr($sql, $start_pos+1, $end_pos-$start_pos-1); - $column_names = split(',', $column_names); + $column_names = explode(',', $column_names); if (!preg_match("/^create unique/", $sql)) { return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null, @@ -532,7 +532,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common */ function getTriggerDefinition($trigger) { - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } @@ -596,7 +596,7 @@ class MDB2_Driver_Reverse_sqlite extends MDB2_Driver_Reverse_Common return parent::tableInfo($result, $mode); } - $db =& $this->getDBInstance(); + $db =$this->getDBInstance(); if (PEAR::isError($db)) { return $db; } diff --git a/3dparty/MDB2/Schema.php b/3dparty/MDB2/Schema.php index 44518b32658..a25a6254403 100644 --- a/3dparty/MDB2/Schema.php +++ b/3dparty/MDB2/Schema.php @@ -237,7 +237,7 @@ class MDB2_Schema extends PEAR * @access public * @see MDB2::parseDSN */ - function &factory(&$db, $options = array()) + static function factory(&$db, $options = array()) { $obj =new MDB2_Schema(); $result = $obj->connect($db, $options); @@ -282,7 +282,7 @@ class MDB2_Schema extends PEAR } $this->disconnect(); if (!MDB2::isConnection($db)) { - $db =& MDB2::factory($db, $db_options); + $db =MDB2::factory($db, $db_options); } if (PEAR::isError($db)) { @@ -2692,9 +2692,9 @@ class MDB2_Schema extends PEAR * @access public * @see PEAR_Error */ - function &raiseError($code = null, $mode = null, $options = null, $userinfo = null) + function raiseError($code = null, $mode = null, $options = null, $userinfo = null,$a=null,$b=null,$c=null) { - $err =& PEAR::raiseError(null, $code, $mode, $options, + $err =PEAR::raiseError(null, $code, $mode, $options, $userinfo, 'MDB2_Schema_Error', true); return $err; } @@ -2713,7 +2713,7 @@ class MDB2_Schema extends PEAR * @return bool true if parameter is an error * @access public */ - function isError($data, $code = null) + static function isError($data, $code = null) { if (is_a($data, 'MDB2_Schema_Error')) { if (is_null($code)) { -- 2.39.5