PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #7080

php complains about static function calls

Details

Submitted2006-03-09 19:21 UTC
Fromenricopulatzo at php dot net
Assigneddanielc
StatusWont fix
PackageDB
PHP Version5.1.2
OSWindows
Roadmaps(Not assigned)

Comments

[2006-03-09 19:21 UTC] enricopulatzo at php dot net

Description:
------------
PHP is notifying that DB::Connect should not be called statically.

The same is happening for DB::isError.

Test script:
---------------
<?php
require 'DB.php';
$db = DB::Connect('');
if (DB::isError($db)) {
print_r($db);
die("Database Connection Error: {$php_errormsg}");
}
$db->disconnect();
?>

Expected result:
----------------
The above code should produce the following:
DB_Error Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => -4
[message] => DB Error: not found
[userinfo] => Unable to include the DB/.php file for ''
[backtrace] => Array
(
[0] => Array
(
[file] => C:\php\PEAR\DB.php
[line] => 888
[function] => PEAR_Error
[class] => PEAR_Error
[object] => DB_Error Object
*RECURSION*
[type] => ->
[args] => Array
(
[0] => DB Error: not found
[1] => -4
[2] => 1
[3] => 1024
[4] => Unable to include the DB/.php file for ''
)

)

[1] => Array
(
[file] => C:\php\PEAR\PEAR.php
[line] => 563
[function] => DB_Error
[class] => DB_Error
[object] => DB_Error Object
*RECURSION*
[type] => ->
[args] => Array
(
[0] => -4
[1] => 1
[2] => 1024
[3] => Unable to include the DB/.php file for ''
)

)

[2] => Array
(
[file] => C:\php\PEAR\DB.php
[line] => 543
[function] => raiseError
[class] => PEAR
[type] => ::
[args] => Array
(
[0] =>
[1] => -4
[2] =>
[3] =>
[4] => Unable to include the DB/.php file for ''
[5] => DB_Error
[6] => 1
)

)

[3] => Array
(
[file] => C:\Documents and Settings\jcpeter\Desktop\dbtest.php
[line] => 3
[function] => connect
[class] => DB
[type] => ::
[args] => Array
(
[0] =>
)

)

)

[callback] =>
)

Actual result:
--------------
DB_Error Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] => -4
[message] => DB Error: not found
[userinfo] => Unable to include the DB/.php file for ''
[backtrace] => Array
(
[0] => Array
(
[file] => C:\php\PEAR\DB.php
[line] => 888
[function] => PEAR_Error
[class] => PEAR_Error
[object] => DB_Error Object
*RECURSION*
[type] => ->
[args] => Array
(
[0] => DB Error: not found
[1] => -4
[2] => 1
[3] => 1024
[4] => Unable to include the DB/.php file for ''
)

)

[1] => Array
(
[file] => C:\php\PEAR\PEAR.php
[line] => 563
[function] => DB_Error
[class] => DB_Error
[object] => DB_Error Object
*RECURSION*
[type] => ->
[args] => Array
(
[0] => -4
[1] => 1
[2] => 1024
[3] => Unable to include the DB/.php file for ''
)

)

[2] => Array
(
[file] => C:\php\PEAR\DB.php
[line] => 543
[function] => raiseError
[class] => PEAR
[type] => ::
[args] => Array
(
[0] =>
[1] => -4
[2] =>
[3] =>
[4] => Unable to include the DB/.php file for ''
[5] => DB_Error
[6] => 1
)

)

[3] => Array
(
[file] => C:\Documents and Settings\jcpeter\Desktop\dbtest.php
[line] => 3
[function] => connect
[class] => DB
[type] => ::
[args] => Array
(
[0] =>
)

)

)

[callback] =>
)
Database Connection Error: Non-static method DB::isError() should not be called statically