diff --git a/PEAR.php b/PEAR.php index a94a3de419d274af59b22b90c85fd723c6de87f2..bd02e82f8d54d7b9ea6c14d3690694b47879fd30 100644 --- a/PEAR.php +++ b/PEAR.php @@ -156,7 +156,7 @@ class PEAR // }}} // {{{ constructor - + /** * Constructor. Registers this object in * $_PEAR_destructor_object_list for destructor emulation if a @@ -167,7 +167,7 @@ class PEAR * @access public * @return void */ - function PEAR($error_class = null) + public function __construct($error_class = null) { $classname = strtolower(get_class($this)); if ($this->_debug) { @@ -191,6 +191,13 @@ class PEAR } } } + function PEAR($error_class = null) + { + // PHP4-style constructor. + // This will NOT be invoked, unless a sub-class that extends `foo` calls it. + // In that case, call the new-style constructor to keep compatibility. + self::__construct(); + } // }}} // {{{ destructor @@ -842,7 +849,7 @@ class PEAR_Error * @access public * */ - function PEAR_Error($message = 'unknown error', $code = null, + public function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { if ($mode === null) { @@ -900,6 +907,15 @@ class PEAR_Error eval('$e = new Exception($this->message, $this->code);throw($e);'); } } + function PEAR_Error($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + // PHP4-style constructor. + // This will NOT be invoked, unless a sub-class that extends `foo` calls it. + // In that case, call the new-style constructor to keep compatibility. + self::__construct(); + + } // }}} // {{{ getMode()