FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18405&edit=1

ID: 18405
Updated by: daniel.oconnor@gmail.com
Reported By: tj+pear at a13 dot fr
Summary: Non-static method PEAR::load Extension() should not
be called statically
-Status: Open
+Status: Analyzed
Type: Bug
Package: XML_RPC2
Operating System: FreeBSD and GNU/Linux
Package Version: 1.0.8
PHP Version: 5.3.6
Roadmap Versions:
New Comment:

-Status: Open
+Status: Analyzed
Quick (if ugly) fix - instantiate a PEAR object and don't call it
statically.

The better fix is probably to stop trying to load extensions in user
code - simply
error if you try to instantiate a backend without the right extension.

public static function setBackend($backend) {

...
$backend == 'Xmlrpcext' &&
!function_exists('xmlrpc_server_create') )
) {
...
throw new XML_RPC2_Exception('Unable to load xmlrpc
extension.');
}
}


Previous Comments:
------------------------------------------------------------------------

[2011-04-21 08:01:23] inzite

This appears to be a bug in PEAR (present as of version 1.9.2, but may
be fixed in later versions). When run in strict mode, PHP 5.3 checks to
make sure that class functions are not called statically unless they've
been declared with the static keyword. PEAR::loadExtension() is allowed
to be called statically, but its implementation omits the static
keyword. Hence you get a runtime warning. This is just a warning and
should not affect program execution.

Note: The documentation for the PEAR::loadExtension() function
specifically states that it can be called statically. See
http://pear.php.net/manual/en/core.pear.pear.loadextension.php

------------------------------------------------------------------------

[2011-03-28 23:13:37] tj

Description:
------------
I got the following PHP error when using the attached test script:

PHP Strict Standards: Non-static method PEAR::load
Extension() should not be called statically in
/usr/local/share/php/XML/RPC2/Backend.php on line 111


Test script:
---------------
https://gist.github.com/891398


Expected result:
----------------
$ php bug_test.php | head -n 5
PHP Notice: Undefined property:
XML_RPC2_Server_Input_PhpInput::$readRequest in
/home/tj/tmp/XML_RPC/XML_RPC2/XML/RPC2/Server/Input/PhpInput.php on line
65
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8"
/>
<title>Available XMLRPC methods for this server</title>


Actual result:
--------------
$ php bug_test.php | head -n 5
PHP Strict Standards: Non-static method PEAR::loadExtension() should
not be called statically in
/home/tj/tmp/XML_RPC/XML_RPC2/XML/RPC2/Backend.php on line 111
PHP Notice: Undefined property:
XML_RPC2_Server_Input_PhpInput::$readRequest in
/home/tj/tmp/XML_RPC/XML_RPC2/XML/RPC2/Server/Input/PhpInput.php on line
65
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8"
/>
<title>Available XMLRPC methods for this server</title>

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMay 29, '11 at 2:35p
activeMay 29, '11 at 2:35p
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase