cvs: php4 /pear PEAR.php
| From: | Stig Bakken | Date: | Sun, 21 Jul 2002 07:04:46 +0000 |
| Subject: | cvs: php4 /pear PEAR.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5234@lists.php.net to get a copy of this message | ||
ssb Sun Jul 21 03:04:46 2002 EDT
Modified files:
/php4/pear PEAR.php
Log:
* always enable track_errors
* added throwError method (simpler version of raiseError)
Index: php4/pear/PEAR.php
diff -u php4/pear/PEAR.php:1.46 php4/pear/PEAR.php:1.47
--- php4/pear/PEAR.php:1.46 Thu Jul 4 21:52:09 2002
+++ php4/pear/PEAR.php Sun Jul 21 03:04:45 2002
@@ -18,7 +18,7 @@
// | Tomas V.V.Cox <cox@idecnet.com> |
// +----------------------------------------------------------------------+
//
-// $Id: PEAR.php,v 1.46 2002/07/05 01:52:09 ssb Exp $
+// $Id: PEAR.php,v 1.47 2002/07/21 07:04:45 ssb Exp $
//
define('PEAR_ERROR_RETURN', 1);
@@ -45,6 +45,8 @@
$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.
@@ -506,6 +508,27 @@
return new $ec($code, $mode, $options, $userinfo);
} else {
return new $ec($message, $code, $mode, $options, $userinfo);
+ }
+ }
+
+ // }}}
+ // {{{ 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);
}
}