Skip to content

Commit

Permalink
E_STRICT, require PHP 5
Browse files Browse the repository at this point in the history
  • Loading branch information
convissor committed Nov 20, 2014
1 parent 06bd409 commit f0a2929
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 41 deletions.
24 changes: 12 additions & 12 deletions DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Database independent query interface
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down Expand Up @@ -431,7 +431,7 @@
*/
class DB
{
// {{{ &factory()
// {{{ factory()

/**
* Create a new DB object for the specified database type but don't
Expand All @@ -444,7 +444,7 @@ class DB
*
* @see DB_common::setOption()
*/
function &factory($type, $options = false)
public static function factory($type, $options = false)
{
if (!is_array($options)) {
$options = array('persistent' => $options);
Expand Down Expand Up @@ -480,7 +480,7 @@ function &factory($type, $options = false)
}

// }}}
// {{{ &connect()
// {{{ connect()

/**
* Create a new DB object including a connection to the specified database
Expand All @@ -495,7 +495,7 @@ function &factory($type, $options = false)
* 'portability' => DB_PORTABILITY_ALL,
* );
*
* $db =& DB::connect($dsn, $options);
* $db = DB::connect($dsn, $options);
* if (PEAR::isError($db)) {
* die($db->getMessage());
* }
Expand All @@ -515,7 +515,7 @@ function &factory($type, $options = false)
*
* @uses DB::parseDSN(), DB_common::setOption(), PEAR::isError()
*/
function &connect($dsn, $options = array())
public static function connect($dsn, $options = array())
{
$dsninfo = DB::parseDSN($dsn);
$type = $dsninfo['phptype'];
Expand Down Expand Up @@ -590,7 +590,7 @@ function apiVersion()
*
* @return bool whether $value is DB_Error object
*/
function isError($value)
public static function isError($value)
{
return is_object($value) && is_a($value, 'DB_Error');
}
Expand All @@ -605,7 +605,7 @@ function isError($value)
*
* @return bool whether $value is a DB_<driver> object
*/
function isConnection($value)
public static function isConnection($value)
{
return (is_object($value) &&
is_subclass_of($value, 'db_common') &&
Expand All @@ -626,7 +626,7 @@ function isConnection($value)
*
* @return boolean whether $query is a data manipulation query
*/
function isManip($query)
public static function isManip($query)
{
$manips = 'INSERT|UPDATE|DELETE|REPLACE|'
. 'CREATE|DROP|'
Expand All @@ -650,7 +650,7 @@ function isManip($query)
* @return string the error message or false if the error code was
* not recognized
*/
function errorMessage($value)
public static function errorMessage($value)
{
static $errorMessages;
if (!isset($errorMessages)) {
Expand Down Expand Up @@ -731,7 +731,7 @@ function errorMessage($value)
* + username: User name for login
* + password: Password for login
*/
function parseDSN($dsn)
public static function parseDSN($dsn)
{
$parsed = array(
'phptype' => false,
Expand Down Expand Up @@ -860,7 +860,7 @@ function parseDSN($dsn)
* @param boolean true to hide the password, false to include it
* @return string
*/
function getDSNString($dsn, $hidePassword) {
public static function getDSNString($dsn, $hidePassword) {
/* Calling parseDSN will ensure that we have all the array elements
* defined, and means that we deal with strings and array in the same
* manner. */
Expand Down
2 changes: 1 addition & 1 deletion DB/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Contains the DB_common base class
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/dbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's dbase extension
* for interacting with dBase databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/fbsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's fbsql extension
* for interacting with FrontBase databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/ibase.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* While this class works with PHP 4, PHP's InterBase extension is
* unstable in PHP 4. Use PHP 5.
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/ifx.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's ifx extension
* for interacting with Informix databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/msql.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
* those versions.
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/mssql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's mssql extension
* for interacting with Microsoft SQL Server databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
4 changes: 2 additions & 2 deletions DB/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's mysql extension
* for interacting with MySQL databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down Expand Up @@ -778,7 +778,7 @@ function quoteIdentifier($str)
/**
* @deprecated Deprecated in release 1.6.0
*/
function quote($str)
function quote($str = null)
{
return $this->quoteSmart($str);
}
Expand Down
2 changes: 1 addition & 1 deletion DB/mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's mysqli extension
* for interacting with MySQL databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/oci8.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's oci8 extension
* for interacting with Oracle databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
4 changes: 2 additions & 2 deletions DB/odbc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's odbc extension
* for interacting with databases via ODBC connections
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down Expand Up @@ -487,7 +487,7 @@ function quoteIdentifier($str)
* @deprecated Deprecated in release 1.6.0
* @internal
*/
function quote($str)
function quote($str = null)
{
return $this->quoteSmart($str);
}
Expand Down
4 changes: 2 additions & 2 deletions DB/pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's pgsql extension
* for interacting with PostgreSQL databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down Expand Up @@ -472,7 +472,7 @@ function freeResult($result)
* @deprecated Deprecated in release 1.6.0
* @internal
*/
function quote($str)
function quote($str = null)
{
return $this->quoteSmart($str);
}
Expand Down
2 changes: 1 addition & 1 deletion DB/sqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's sqlite extension
* for interacting with SQLite databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/storage.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* Provides an object interface to a table row
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
2 changes: 1 addition & 1 deletion DB/sybase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The PEAR DB driver for PHP's sybase extension
* for interacting with Sybase databases
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
11 changes: 6 additions & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension, but it can&apos;t be used
interchangeably because dbase doesn&apos;t
support many standard DBMS features.

DB is compatible with both PHP 4 and PHP 5.
DB is compatible with PHP 5.

</description>
<lead>
Expand All @@ -65,17 +65,18 @@ DB is compatible with both PHP 4 and PHP 5.
<email>cox@idecnet.com</email>
<active>no</active>
</developer>
<date>xxx</date>
<date>2014-11-20</date>
<version>
<release>1.7.15</release>
<api>1.7.15</api>
<release>1.8.0</release>
<api>1.8.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP License</license>
<notes>
* E_STRICT compliance, require PHP 5.
* Fix array to string conversion in connect() when class does not exist.
</notes>
<contents>
Expand Down Expand Up @@ -193,7 +194,7 @@ DB is compatible with both PHP 4 and PHP 5.
<dependencies>
<required>
<php>
<min>4.2.0</min>
<min>5.0.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
Expand Down
2 changes: 1 addition & 1 deletion tests/db_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $e = $dbh->raiseError("return testing error");
print strtolower($e->toString()) . "\n";

print "global default: ";
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "myfunc2");
@PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, "myfunc2");
$e = $dbh->raiseError("global default test");

$dbh->setErrorHandling(PEAR_ERROR_PRINT);
Expand Down
2 changes: 1 addition & 1 deletion tests/driver/01connect.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ foreach ($test_array_dsn as $key => $value) {
}
}

$dbha =& DB::connect($test_array_dsn, $options);
$dbha = DB::connect($test_array_dsn, $options);
check_dbh($dbha, '$dbha');


Expand Down
2 changes: 1 addition & 1 deletion tests/driver/connect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if ($dbms == 'mssql') {
ini_set('mssql.textsize', 4096);
}

$dbh =& DB::connect($dsn, $options);
$dbh = DB::connect($dsn, $options);
if (DB::isError($dbh)) {
die('connect.inc: ' . $dbh->toString());
}
2 changes: 1 addition & 1 deletion tests/driver/multiconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Tests the various ways DB's connect() function operates
*
* PHP versions 4 and 5
* PHP version 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
Expand Down
4 changes: 2 additions & 2 deletions tests/sequences.inc
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ if (!DB::isError($d)) {
// 5) test that the sequence is handled right when the table is empty

// Backend with real sequences may don't like that
PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
@PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
$dbh->query('DELETE FROM test_seq');
PEAR::popErrorHandling();
@PEAR::popErrorHandling();
$e = $dbh->nextID('test');
if (DB::isError($d)) {
print 'e: ' . $d->getDebugInfo() . "\n\n";
Expand Down

0 comments on commit f0a2929

Please sign in to comment.