* @access public
* @return void
*/
- function PEAR($error_class = null)
+ function __construct($error_class = null)
{
$classname = strtolower(get_class($this));
- print_R($classname);exit;
if ($this->_debug) {
print "PEAR constructor called, class=$classname\n";
}
* @param mixed $args The arguments to pass to the function
* @return void
*/
- function registerShutdownFunc($func, $args = array())
+ static function registerShutdownFunc($func, $args = array())
{
// if we are called statically, there is a potential
// that no shutdown func is registered. Bug #6445
* @param string $ext The extension name
* @return bool Success or not on the dl() call
*/
- function loadExtension($ext)
+ static function loadExtension($ext)
{
if (extension_loaded($ext)) {
return true;
}
-
+
// if either returns true dl() will produce a FATAL error, stop that
if (
function_exists('dl') === false ||
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
}
- while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
+ foreach($_PEAR_destructor_object_list as $k => $objref){
$classname = get_class($objref);
while ($classname) {
$destructor = "_$classname";
var $message = '';
var $userinfo = '';
var $backtrace = null;
-
+ var $callback;
/**
* PEAR_Error constructor
*
* @access public
*
*/
- function PEAR_Error($message = 'unknown error', $code = null,
+ function __construct($message = 'unknown error', $code = null,
$mode = null, $options = null, $userinfo = null)
{
if ($mode === null) {
}
if ($this->mode & PEAR_ERROR_EXCEPTION) {
- trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
- eval('$e = new Exception($this->message, $this->code);throw($e);');
+ //trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
+ $e = new Exception($this->message, $this->code);throw($e);
}
}
strtolower(get_class($this)), $this->message, $this->code,
implode("|", $modes), $levels[$this->level],
$this->error_message_prefix,
- $this->userinfo);
+ is_string($this->userinfo) ? $this->userinfo : print_r($this->userinfo,true));
}
}