ssb             Sat Mar 10 01:59:16 2001 EDT

  Modified files:              
    /php4/pear  PEAR.php.in 
  Log:
  * only register the destructor if it exists
  
  
Index: php4/pear/PEAR.php.in
diff -u php4/pear/PEAR.php.in:1.14 php4/pear/PEAR.php.in:1.15
--- php4/pear/PEAR.php.in:1.14  Thu Feb  1 12:15:08 2001
+++ php4/pear/PEAR.php.in       Sat Mar 10 01:59:15 2001
@@ -17,7 +17,7 @@
 // |          Stig Bakken <[EMAIL PROTECTED]>                                   |
 // +----------------------------------------------------------------------+
 //
-// $Id: PEAR.php.in,v 1.14 2001/02/01 20:15:08 cmv Exp $
+// $Id: PEAR.php.in,v 1.15 2001/03/10 09:59:15 ssb Exp $
 //
 
 define('PEAR_ERROR_RETURN', 1);
@@ -73,11 +73,14 @@
 
     /**
      * Constructor.  Registers this object in
-     * $_PEAR_destructor_object_list for destructor emulation.
+     * $_PEAR_destructor_object_list for destructor emulation if a
+     * destructor object exists.
      */
     function PEAR() {
-        global $_PEAR_destructor_object_list;
-        $_PEAR_destructor_object_list[] = &$this;
+        if (method_exists($this, "_".get_class($this))) {
+            global $_PEAR_destructor_object_list;
+            $_PEAR_destructor_object_list[] = &$this;
+        }
         if ($this->_debug) {
             printf("PEAR constructor called, class=%s\n",
                    get_class($this));
@@ -199,7 +202,30 @@
     // {{{ raiseError()
 
     /**
-     * This method is called by DB to generate an error.
+     * This method is a wrapper that returns an instance of PEAR_Error
+     * with this object's default error handling applied.  If the
+     * $mode and $options parameters are not specified, the object's
+     * defaults are used.
+     *
+     * @param $message  a text error message
+     * @param $code     a numeric error code (it is up to your class
+     *                  to define these if you want to use codes)
+     * @param $mode     One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
+     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE or
+     *                  PEAR_ERROR_CALLBACK.
+     * @param $options  If $mode is PEAR_ERROR_TRIGGER, this parameter
+     *                  specifies the PHP-internal error level (one of
+     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
+     *                  If $mode is PEAR_ERROR_CALLBACK, this
+     *                  parameter specifies the callback function or
+     *                  method.  In other error modes this parameter
+     *                  is ignored.
+     * @param $userinfo If you need to pass along for example debug
+     *                  information, this parameter is meant for that.
+     *
+     * @return object   a PEAR error object
+     *
+     * @see PEAR::setErrorHandling
      *
      * @since PHP 4.0.5
      */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to