$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
$GLOBALS['_PEAR_destructor_object_list'] = array();
-//
-// Tests needed: - PEAR inheritance
-//
-
/**
* Base class for other PEAR classes. Provides rudimentary
* emulation of destructors.
* discarded. If you need to get any debug information from your
* destructor, use error_log(), syslog() or something similar.
*
+ * IMPORTANT! To use the emulated destructors you need to create the
+ * objects by reference, ej: $obj =& new PEAR_child;
+ *
* @since PHP 4.0.2
* @author Stig Bakken <ssb@fast.no>
+ * @see http://pear.php.net/manual/
*/
class PEAR
{
* $_PEAR_destructor_object_list for destructor emulation if a
* destructor object exists.
*
- * @param string (optional) which class to use for error objects,
- * defaults to PEAR_Error.
+ * @param string $error_class (optional) which class to use for error
+ * objects, defaults to PEAR_Error.
* @access public
* @return void
*/
/**
* Tell whether a value is a PEAR error.
*
- * @param mixed the value to test
+ * @param mixed $data the value to test
* @access public
* @return bool true if parameter is an error
*/
* expected errors are in effect until they are popped off the
* stack with the popExpect() method.
*
- * @param mixed a single error code or an array of error codes
- * to expect
+ * Note that this method can not be called statically
+ *
+ * @param mixed $code a single error code or an array of error codes
+ * to expect
*
* @return int the new depth of the "expected errors" stack
+ * @access public
*/
- function expectError($code = "*")
+ function expectError($code = '*')
{
if (is_array($code)) {
array_push($this->_expected_errors, $code);
* you can easily override the actual error handler for some code and restore
* it later with popErrorHandling.
*
- * @param $mode mixed (same as setErrorHandling)
+ * @param $mode mixed (same as setErrorHandling)
* @param $options mixed (same as setErrorHandling)
*
* @return bool Always true
* @return string full error message
* @access public
*/
- function getMessage ()
+ function getMessage()
{
return ($this->error_message_prefix . $this->message);
}
* @return string error/exception name (type)
* @access public
*/
- function getType ()
+ function getType()
{
return get_class($this);
}
* @return string user-supplied information
* @access public
*/
- function getUserInfo ()
+ function getUserInfo()
{
return $this->userinfo;
}
* @return string debug information
* @access public
*/
- function getDebugInfo ()
+ function getDebugInfo()
{
return $this->getUserInfo();
}