bundled-libs/PEAR.php issue
Posted: Thu Oct 18, 2007 7:13 pm
Hi,
we've been experiencing a strange problem with PEAR's error constants not being defined. The actual place where this happens is the podcast event plugin (serendipity_event_podcast). It's not a plugin issue, its something that I think affects every code that uses the bundled PEAR libs (HTTP/Request,Net/Socket etc.)
Inside bundled-libs/PEAR.php there is a:
This actually prevent the initialization of the constants and other GLOBALS[] data, as the class gets actually defined (compiled), but the statements do not run at all.
You can test for yourself with something like:
If the condition around class_exists() is removed, the constants and GLOBALS are initialized properly.
The effect of this, is that module don't actually control the PEAR error reporting mechanisms, unless they redefine those constants, which may or may not be an actual issue.
I guess a workaround inside PEAR.php would be using the trick like in other places around the source:
# PEAR.php
if ( defined('S9Y_PEAR') ) return false;
define ('S9Y_PEAR', 1);
here's my OS info:
6.2-STABLE FreeBSD 6.2-STABLE #1
PHP 4.4.7 with Suhosin-Patch 0.9.6 (cli) (built: Jul 30 2007 21:40:22)
Zend Engine v1.3.0
Apache/1.3.37 (Unix)
EDIT:
the s9y version is the latest official release - 1.2
we've been experiencing a strange problem with PEAR's error constants not being defined. The actual place where this happens is the podcast event plugin (serendipity_event_podcast). It's not a plugin issue, its something that I think affects every code that uses the bundled PEAR libs (HTTP/Request,Net/Socket etc.)
Inside bundled-libs/PEAR.php there is a:
Code: Select all
if ( class_exists('PEAR') ) {
return false;
}
You can test for yourself with something like:
Code: Select all
<?php
require_once 'bundled-libs/PEAR.php';
echo "pear const: " . PEAR_ERROR_RETURN . " <<\n";
var_dump($GLOBALS); // make sure to grep for '^_PEAR'
?>
The effect of this, is that module don't actually control the PEAR error reporting mechanisms, unless they redefine those constants, which may or may not be an actual issue.
I guess a workaround inside PEAR.php would be using the trick like in other places around the source:
# PEAR.php
if ( defined('S9Y_PEAR') ) return false;
define ('S9Y_PEAR', 1);
here's my OS info:
6.2-STABLE FreeBSD 6.2-STABLE #1
PHP 4.4.7 with Suhosin-Patch 0.9.6 (cli) (built: Jul 30 2007 21:40:22)
Zend Engine v1.3.0
Apache/1.3.37 (Unix)
EDIT:
the s9y version is the latest official release - 1.2