From: <var...@us...> - 2016-01-05 20:16:23
|
Revision: 9748 http://sourceforge.net/p/phpwiki/code/9748 Author: vargenau Date: 2016-01-05 20:16:20 +0000 (Tue, 05 Jan 2016) Log Message: ----------- Update Pear DB to release 1.9.2 Modified Paths: -------------- trunk/lib/pear/DB/common.php trunk/lib/pear/DB/dbase.php trunk/lib/pear/DB/fbsql.php trunk/lib/pear/DB/ibase.php trunk/lib/pear/DB/ifx.php trunk/lib/pear/DB/msql.php trunk/lib/pear/DB/mssql.php trunk/lib/pear/DB/mysql.php trunk/lib/pear/DB/mysqli.php trunk/lib/pear/DB/oci8.php trunk/lib/pear/DB/odbc.php trunk/lib/pear/DB/pgsql.php trunk/lib/pear/DB/sqlite.php trunk/lib/pear/DB/storage.php trunk/lib/pear/DB/sybase.php trunk/lib/pear/DB.php Modified: trunk/lib/pear/DB/common.php =================================================================== --- trunk/lib/pear/DB/common.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/common.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -42,7 +42,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_common extends PEAR @@ -145,7 +145,7 @@ * * @return void */ - function DB_common() + function __construct() { $this->PEAR('DB_Error'); } Modified: trunk/lib/pear/DB/dbase.php =================================================================== --- trunk/lib/pear/DB/dbase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/dbase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_dbase extends DB_common @@ -140,13 +140,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_dbase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/fbsql.php =================================================================== --- trunk/lib/pear/DB/fbsql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/fbsql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.7.0 */ @@ -124,13 +124,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_fbsql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/ibase.php =================================================================== --- trunk/lib/pear/DB/ibase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/ibase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class became stable in Release 1.7.0 */ @@ -180,13 +180,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_ibase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/ifx.php =================================================================== --- trunk/lib/pear/DB/ifx.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/ifx.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -48,7 +48,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_ifx extends DB_common @@ -167,13 +167,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_ifx() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/msql.php =================================================================== --- trunk/lib/pear/DB/msql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/msql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class not functional until Release 1.7.0 */ @@ -126,13 +126,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_msql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mssql.php =================================================================== --- trunk/lib/pear/DB/mssql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mssql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -49,7 +49,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_mssql extends DB_common @@ -179,13 +179,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mssql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mysql.php =================================================================== --- trunk/lib/pear/DB/mysql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mysql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -41,7 +41,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_mysql extends DB_common @@ -162,13 +162,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mysql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/mysqli.php =================================================================== --- trunk/lib/pear/DB/mysqli.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/mysqli.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @since Class functional since Release 1.6.3 */ @@ -224,13 +224,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_mysqli() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} @@ -497,7 +497,11 @@ */ function freeResult($result) { - return is_resource($result) ? mysqli_free_result($result) : false; + if (! $result instanceof mysqli_result) { + return false; + } + mysqli_free_result($result); + return true; } // }}} @@ -1031,6 +1035,10 @@ ? $this->mysqli_types[$tmp->type] : 'unknown', // http://bugs.php.net/?id=36579 + // Doc Bug #36579: mysqli_fetch_field length handling + // https://bugs.php.net/bug.php?id=62426 + // Bug #62426: mysqli_fetch_field_direct returns incorrect + // length on UTF8 fields 'len' => $tmp->length, 'flags' => $flags, ); Modified: trunk/lib/pear/DB/oci8.php =================================================================== --- trunk/lib/pear/DB/oci8.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/oci8.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_oci8 extends DB_common @@ -173,13 +173,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_oci8() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/odbc.php =================================================================== --- trunk/lib/pear/DB/odbc.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/odbc.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -44,7 +44,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_odbc extends DB_common @@ -153,13 +153,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_odbc() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/pgsql.php =================================================================== --- trunk/lib/pear/DB/pgsql.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/pgsql.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -43,7 +43,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_pgsql extends DB_common @@ -148,13 +148,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_pgsql() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/sqlite.php =================================================================== --- trunk/lib/pear/DB/sqlite.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/sqlite.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -47,7 +47,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_sqlite extends DB_common @@ -152,13 +152,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_sqlite() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB/storage.php =================================================================== --- trunk/lib/pear/DB/storage.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/storage.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -38,7 +38,7 @@ * @author Stig Bakken <st...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_storage extends PEAR @@ -94,7 +94,7 @@ * a reference to this object * */ - function DB_storage($table, $keycolumn, &$dbh, $validator = null) + function __construct($table, $keycolumn, &$dbh, $validator = null) { $this->PEAR('DB_Error'); $this->_table = $table; Modified: trunk/lib/pear/DB/sybase.php =================================================================== --- trunk/lib/pear/DB/sybase.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB/sybase.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -17,7 +17,7 @@ * @category Database * @package DB * @author Sterling Hughes <ste...@ph...> - * @author Antônio Carlos Venâncio Júnior <fl...@ph...> + * @author Antônio Carlos Venâncio Júnior * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 @@ -42,11 +42,11 @@ * @category Database * @package DB * @author Sterling Hughes <ste...@ph...> - * @author Antônio Carlos Venâncio Júnior <fl...@ph...> + * @author Antônio Carlos Venâncio Júnior * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_sybase extends DB_common @@ -141,13 +141,13 @@ // {{{ constructor /** - * This constructor calls <kbd>$this->DB_common()</kbd> + * This constructor calls <kbd>parent::__construct()</kbd> * * @return void */ - function DB_sybase() + function __construct() { - $this->DB_common(); + parent::__construct(); } // }}} Modified: trunk/lib/pear/DB.php =================================================================== --- trunk/lib/pear/DB.php 2015-12-14 10:03:50 UTC (rev 9747) +++ trunk/lib/pear/DB.php 2016-01-05 20:16:20 UTC (rev 9748) @@ -426,7 +426,7 @@ * @author Daniel Convissor <da...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB @@ -577,7 +577,7 @@ */ function apiVersion() { - return '1.8.2'; + return '1.9.2'; } // }}} @@ -941,7 +941,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_Error extends PEAR_Error @@ -959,18 +959,32 @@ * * @see PEAR_Error */ - function DB_Error($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, + function __construct($code = DB_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null) { if (is_int($code)) { - $this->PEAR_Error('DB Error: ' . DB::errorMessage($code), $code, + parent::__construct('DB Error: ' . DB::errorMessage($code), $code, $mode, $level, $debuginfo); } else { - $this->PEAR_Error("DB Error: $code", DB_ERROR, + parent::__construct("DB Error: $code", DB_ERROR, $mode, $level, $debuginfo); } } + /** + * Workaround to both avoid the "Redefining already defined constructor" + * PHP error and provide backward compatibility in case someone is calling + * DB_Error() dynamically + */ + public function __call($method, $arguments) + { + if ($method == 'DB_Error') { + return call_user_func_array(array($this, '__construct'), $arguments); + } + trigger_error( + 'Call to undefined method DB_Error::' . $method . '()', E_USER_ERROR + ); + } // }}} } @@ -988,7 +1002,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB */ class DB_result @@ -1095,7 +1109,7 @@ * * @return void */ - function DB_result(&$dbh, $result, $options = array()) + function __construct(&$dbh, $result, $options = array()) { $this->autofree = $dbh->options['autofree']; $this->dbh = &$dbh; @@ -1453,7 +1467,7 @@ * @author Stig Bakken <ss...@ph...> * @copyright 1997-2007 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version Release: 1.8.2 + * @version Release: 1.9.2 * @link http://pear.php.net/package/DB * @see DB_common::setFetchMode() */ @@ -1468,7 +1482,7 @@ * * @return void */ - function DB_row(&$arr) + function __construct(&$arr) { foreach ($arr as $key => $value) { $this->$key = &$arr[$key]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |