/**
* 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));
// {{{ 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
*/