|
static | _popErrorHandling ($object) |
|
static | _pushErrorHandling ($object, $mode, $options=null) |
|
static | _raiseError ($object, $message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false) |
|
static | _setErrorHandling ( $object, $mode=null, $options=null) |
|
static | _throwError ($object, $message=null, $code=null, $userinfo=null) |
|
Definition at line 84 of file PEAR.php.
◆ __construct()
PEAR::__construct |
( |
|
$error_class = null | ) |
|
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
- Parameters
-
string | $error_class | (optional) which class to use for error objects, defaults to PEAR_Error. @access public |
- Returns
- void
Definition at line 176 of file PEAR.php.
References $GLOBALS.
Referenced by PEAR().
◆ __call()
PEAR::__call |
( |
|
$method, |
|
|
|
$arguments |
|
) |
| |
◆ __callStatic()
static PEAR::__callStatic |
( |
|
$method, |
|
|
|
$arguments |
|
) |
| |
|
static |
◆ _checkDelExpect()
PEAR::_checkDelExpect |
( |
|
$error_code | ) |
|
This method checks unsets an error code if available
- Parameters
-
- Returns
- bool true if the error code was unset, false otherwise @access private
- Since
- PHP 4.3.0
Definition at line 452 of file PEAR.php.
Referenced by delExpect().
◆ _PEAR()
Destructor (the emulated type of...). Does nothing right now, but is included for forward compatibility, so subclass destructors should always call it.
See the note in the class desciption about output from destructors.
@access public
- Returns
- void
Definition at line 226 of file PEAR.php.
◆ _popErrorHandling()
static PEAR::_popErrorHandling |
( |
|
$object | ) |
|
|
staticprotected |
Pop the last error handler used
- Returns
- bool Always true
- See also
- PEAR::pushErrorHandling
Definition at line 738 of file PEAR.php.
References $GLOBALS.
◆ _pushErrorHandling()
static PEAR::_pushErrorHandling |
( |
|
$object, |
|
|
|
$mode, |
|
|
|
$options = null |
|
) |
| |
|
staticprotected |
Push a new error handler on top of the error handler options stack. With this you can easily override the actual error handler for some code and restore it later with popErrorHandling.
- Parameters
-
mixed | $mode | (same as setErrorHandling) |
mixed | $options | (same as setErrorHandling) |
- Returns
- bool Always true
- See also
- PEAR::setErrorHandling
Definition at line 710 of file PEAR.php.
References $GLOBALS.
◆ _raiseError()
static PEAR::_raiseError |
( |
|
$object, |
|
|
|
$message = null , |
|
|
|
$code = null , |
|
|
|
$mode = null , |
|
|
|
$options = null , |
|
|
|
$userinfo = null , |
|
|
|
$error_class = null , |
|
|
|
$skipmsg = false |
|
) |
| |
|
staticprotected |
This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. If the $mode and $options parameters are not specified, the object's defaults are used.
- Parameters
-
mixed | $message | a text error message or a PEAR error object |
int | $code | a numeric error code (it is up to your class to define these if you want to use codes) |
int | $mode | One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION. |
mixed | $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. |
string | $userinfo | If you need to pass along for example debug information, this parameter is meant for that. |
string | $error_class | The returned error object will be instantiated from this class, if specified. |
bool | $skipmsg | If true, raiseError will only pass error codes, the error message parameter will be dropped. |
- Returns
- object a PEAR error object
- See also
- PEAR::setErrorHandling
- Since
- PHP 4.0.5
Definition at line 539 of file PEAR.php.
References $GLOBALS.
◆ _setErrorHandling()
static PEAR::_setErrorHandling |
( |
|
$object, |
|
|
|
$mode = null , |
|
|
|
$options = null |
|
) |
| |
|
staticprotected |
Sets how errors generated by this object should be handled. Can be invoked both in objects and statically. If called statically, setErrorHandling sets the default behaviour for all PEAR objects. If called in an object, setErrorHandling sets the default behaviour for that object.
- Parameters
-
object | $object | Object the method was called on (non-static mode) |
int | $mode | One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION. |
mixed | $options | When $mode is PEAR_ERROR_TRIGGER, this is the error level (one of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR). |
When $mode is PEAR_ERROR_CALLBACK, this parameter is expected to be the callback function or method. A callback function is a string with the name of the function, a callback method is an array of two elements: the element at index 0 is the object, and the element at index 1 is the name of the method to call in the object.
When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is a printf format string used when printing the error message.
@access public
- Returns
- void
- See also
- PEAR_ERROR_RETURN
-
PEAR_ERROR_PRINT
-
PEAR_ERROR_TRIGGER
-
PEAR_ERROR_DIE
-
PEAR_ERROR_CALLBACK
-
PEAR_ERROR_EXCEPTION
- Since
- PHP 4.0.5
Definition at line 370 of file PEAR.php.
References $GLOBALS.
◆ _throwError()
static PEAR::_throwError |
( |
|
$object, |
|
|
|
$message = null , |
|
|
|
$code = null , |
|
|
|
$userinfo = null |
|
) |
| |
|
staticprotected |
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
- Parameters
-
mixed | $message | a text error message or a PEAR error object |
int | $code | a numeric error code (it is up to your class to define these if you want to use codes) |
string | $userinfo | If you need to pass along for example debug information, this parameter is meant for that. |
- Returns
- object a PEAR error object
- See also
- PEAR::raiseError
Definition at line 616 of file PEAR.php.
◆ delExpect()
PEAR::delExpect |
( |
|
$error_code | ) |
|
This method deletes all occurrences of the specified element from the expected error codes stack.
- Parameters
-
mixed | $error_code | error code that should be deleted |
- Returns
- mixed list of error codes that were deleted or error @access public
- Since
- PHP 4.3.0
Definition at line 479 of file PEAR.php.
References _checkDelExpect().
◆ expectError()
PEAR::expectError |
( |
|
$code = '*' | ) |
|
This method is used to tell which errors you expect to get. Expected errors are always returned with error mode PEAR_ERROR_RETURN. Expected error codes are stored in a stack, and this method pushes a new element onto it. The list of expected errors are in effect until they are popped off the stack with the popExpect() method.
Note that this method can not be called statically
- Parameters
-
mixed | $code | a single error code or an array of error codes to expect |
- Returns
- int the new depth of the "expected errors" stack @access public
Definition at line 423 of file PEAR.php.
◆ getSourceDateEpoch()
static PEAR::getSourceDateEpoch |
( |
| ) |
|
|
static |
◆ getStaticProperty()
static& PEAR::getStaticProperty |
( |
|
$class, |
|
|
|
$var |
|
) |
| |
|
static |
If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. Eg. in your method(s) do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); You MUST use a reference, or they will not persist!
- Parameters
-
string | $class | The calling classname, to prevent clashes |
string | $var | The variable to retrieve. |
- Returns
- mixed A reference to the variable. If not set it will be auto initialised to NULL.
Definition at line 269 of file PEAR.php.
Referenced by PEAR_Error\__construct().
◆ isError()
static PEAR::isError |
( |
|
$data, |
|
|
|
$code = null |
|
) |
| |
|
static |
◆ loadExtension()
static PEAR::loadExtension |
( |
|
$ext | ) |
|
|
static |
OS independent PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
- Parameters
-
string | $ext | The extension name |
- Returns
- bool Success or not on the dl() call
Definition at line 759 of file PEAR.php.
Referenced by Archive_Tar\__construct().
◆ PEAR()
PEAR::PEAR |
( |
|
$error_class = null | ) |
|
◆ popExpect()
This method pops one element off the expected error codes stack.
- Returns
- array the list of error codes that were popped
Definition at line 439 of file PEAR.php.
◆ registerShutdownFunc()
static PEAR::registerShutdownFunc |
( |
|
$func, |
|
|
|
$args = array() |
|
) |
| |
|
static |
Use this function to register a shutdown method for static classes.
- Parameters
-
mixed | $func | The function name (or array of class/method) to call |
mixed | $args | The arguments to pass to the function |
- Returns
- void
Definition at line 292 of file PEAR.php.
References $GLOBALS.
Referenced by System\mktemp().
◆ staticPopErrorHandling()
static PEAR::staticPopErrorHandling |
( |
| ) |
|
|
static |
◆ staticPushErrorHandling()
static PEAR::staticPushErrorHandling |
( |
|
$mode, |
|
|
|
$options = null |
|
) |
| |
|
static |
◆ $_debug
bool PEAR::$_debug = false |
Whether to enable internal debug messages.
@access private
Definition at line 95 of file PEAR.php.
◆ $_default_error_handler
string PEAR::$_default_error_handler = '' |
Default error handler (callback) for this object, if error mode is PEAR_ERROR_CALLBACK.
@access private
Definition at line 130 of file PEAR.php.
◆ $_default_error_mode
int PEAR::$_default_error_mode = null |
Default error mode for this object.
@access private
Definition at line 106 of file PEAR.php.
◆ $_default_error_options
int PEAR::$_default_error_options = null |
Default error options used for this object when error mode is PEAR_ERROR_TRIGGER.
@access private
Definition at line 118 of file PEAR.php.
◆ $_error_class
Which class to use for error objects.
@access private
Definition at line 141 of file PEAR.php.
◆ $_expected_errors
array PEAR::$_expected_errors = array() |
An array of expected errors.
@access private
Definition at line 152 of file PEAR.php.
◆ $bivalentMethods
Initial value:= array(
'setErrorHandling' => true,
'raiseError' => true,
'throwError' => true,
'pushErrorHandling' => true,
'popErrorHandling' => true,
)
Definition at line 158 of file PEAR.php.
The documentation for this class was generated from the following file: