]> granicus.if.org Git - php/commitdiff
* always enable track_errors
authorStig Bakken <ssb@php.net>
Sun, 21 Jul 2002 07:04:45 +0000 (07:04 +0000)
committerStig Bakken <ssb@php.net>
Sun, 21 Jul 2002 07:04:45 +0000 (07:04 +0000)
* added throwError method (simpler version of raiseError)

pear/PEAR.php

index 8b29290cb9055dc95cbb5aeb93dbdd5666e528bd..1541390db393a41ab3da5ad1e551e9ba54ea4a8f 100644 (file)
@@ -45,6 +45,8 @@ $GLOBALS['_PEAR_destructor_object_list'] = array();
 $GLOBALS['_PEAR_shutdown_funcs']         = array();
 $GLOBALS['_PEAR_error_handler_stack']    = array();
 
+ini_set('track_errors', true);
+
 /**
  * Base class for other PEAR classes.  Provides rudimentary
  * emulation of destructors.
@@ -509,6 +511,27 @@ class PEAR
         }
     }
 
+    // }}}
+    // {{{ throwError()
+
+    /**
+     * Simpler form of raiseError with fewer options.  In most cases
+     * message, code and userinfo are enough.
+     *
+     * @param string $message
+     *
+     */
+    function &throwError($message = null,
+                         $code = null,
+                         $userinfo = null)
+    {
+        if (isset($this)) {
+            return $this->raiseError($message, $code, null, null, $userinfo);
+        } else {
+            return PEAR::raiseError($message, $code, null, null, $userinfo);
+        }
+    }
+
     // }}}
     // {{{ pushErrorHandling()