Update PEAR DB to 1.9.2

Source: https://pear.php.net/package/DB
Release date: 2015-11-24
This commit is contained in:
Mikael Nordfeldth 2017-07-10 13:33:11 +02:00
parent 711f220397
commit 3158f9c33a
16 changed files with 89 additions and 67 deletions

View File

@ -426,7 +426,7 @@ define('DB_PORTABILITY_ALL', 63);
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB
*/
function apiVersion()
{
return '1.8.2';
return '1.9.2';
}
// }}}
@ -941,7 +941,7 @@ class DB
* @author Stig Bakken <ssb@php.net>
* @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 @@ class DB_Error extends PEAR_Error
*
* @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 @@ class DB_Error extends PEAR_Error
* @author Stig Bakken <ssb@php.net>
* @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 @@ class DB_result
*
* @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 @@ class DB_result
* @author Stig Bakken <ssb@php.net>
* @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 @@ class DB_row
*
* @return void
*/
function DB_row(&$arr)
function __construct(&$arr)
{
foreach ($arr as $key => $value) {
$this->$key = &$arr[$key];

View File

@ -42,7 +42,7 @@ require_once 'PEAR.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_common extends PEAR
*
* @return void
*/
function DB_common()
function __construct()
{
$this->PEAR('DB_Error');
}

View File

@ -41,7 +41,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_dbase extends DB_common
// {{{ 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();
}
// }}}

View File

@ -41,7 +41,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_fbsql extends DB_common
// {{{ 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();
}
// }}}

View File

@ -49,7 +49,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_ibase extends DB_common
// {{{ 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();
}
// }}}

View File

@ -48,7 +48,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_ifx extends DB_common
// {{{ 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();
}
// }}}

View File

@ -47,7 +47,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_msql extends DB_common
// {{{ 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();
}
// }}}

View File

@ -49,7 +49,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_mssql extends DB_common
// {{{ 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();
}
// }}}

View File

@ -41,7 +41,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_mysql extends DB_common
// {{{ 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();
}
// }}}

View File

@ -43,7 +43,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_mysqli extends DB_common
// {{{ 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 @@ class DB_mysqli extends DB_common
*/
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 @@ class DB_mysqli extends DB_common
? $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,
);

View File

@ -47,7 +47,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_oci8 extends DB_common
// {{{ 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();
}
// }}}

View File

@ -44,7 +44,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_odbc extends DB_common
// {{{ 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();
}
// }}}

View File

@ -43,7 +43,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_pgsql extends DB_common
// {{{ 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();
}
// }}}

View File

@ -47,7 +47,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_sqlite extends DB_common
// {{{ 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();
}
// }}}

View File

@ -38,7 +38,7 @@ require_once 'DB.php';
* @author Stig Bakken <stig@php.net>
* @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 @@ class DB_storage extends PEAR
* 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;

View File

@ -46,7 +46,7 @@ require_once 'DB/common.php';
* @author Daniel Convissor <danielc@php.net>
* @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 @@ class DB_sybase extends DB_common
// {{{ 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();
}
// }}}