![]() |
Bearsampp 2026.9.23
|
Public Member Functions | |
| __call ($method, $arguments) | |
| __construct ($error_class=null) | |
| _checkDelExpect ($error_code) | |
| _PEAR () | |
| delExpect ($error_code) | |
| expectError ($code=' *') | |
| PEAR ($error_class=null) | |
| popExpect () | |
Static Public Member Functions | |
| static | __callStatic ($method, $arguments) |
| static | getSourceDateEpoch () |
| static & | getStaticProperty ($class, $var) |
| static | isError ($data, $code=null) |
| static | loadExtension ($ext) |
| static | registerShutdownFunc ($func, $args=array()) |
| static | staticPopErrorHandling () |
| static | staticPushErrorHandling ($mode, $options=null) |
Data Fields | |
| $_debug = false | |
| $_default_error_handler = '' | |
| $_default_error_mode = null | |
| $_default_error_options = null | |
| $_error_class = 'PEAR_Error' | |
| $_expected_errors = array() | |
Static Protected Member Functions | |
| 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) |
Static Protected Attributes | |
| static | $bivalentMethods |
| __construct | ( | $error_class = null | ) |
Constructor. Registers this object in $_PEAR_destructor_object_list for destructor emulation if a destructor object exists.
| string | $error_class | (optional) which class to use for error objects, defaults to PEAR_Error. @access public |
Definition at line 160 of file PEAR.php.
References $GLOBALS.
| __call | ( | $method, | |
| $arguments ) |
Definition at line 216 of file PEAR.php.
References E_USER_ERROR.
|
static |
Definition at line 233 of file PEAR.php.
References E_USER_ERROR.
| _checkDelExpect | ( | $error_code | ) |
This method checks unsets an error code if available
| mixed | error code |
Definition at line 444 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
Definition at line 210 of file PEAR.php.
|
staticprotected |
Pop the last error handler used
|
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.
| mixed | $mode | (same as setErrorHandling) |
| mixed | $options | (same as setErrorHandling) |
Definition at line 702 of file PEAR.php.
|
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.
| 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. |
Definition at line 531 of file PEAR.php.
References $GLOBALS, $options, and PEAR_ERROR_RETURN.
|
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.
| 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
Definition at line 362 of file PEAR.php.
References $GLOBALS, $options, PEAR_ERROR_CALLBACK, PEAR_ERROR_DIE, PEAR_ERROR_EXCEPTION, PEAR_ERROR_PRINT, PEAR_ERROR_RETURN, and PEAR_ERROR_TRIGGER.
|
staticprotected |
Simpler form of raiseError with fewer options. In most cases message, code and userinfo are enough.
| 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. |
Definition at line 608 of file PEAR.php.
| delExpect | ( | $error_code | ) |
This method deletes all occurrences of the specified element from the expected error codes stack.
| mixed | $error_code | error code that should be deleted |
Definition at line 471 of file PEAR.php.
References _checkDelExpect().
| 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
| mixed | $code | a single error code or an array of error codes to expect |
Definition at line 415 of file PEAR.php.
Referenced by PEAR_Installer\install().
|
static |
Get SOURCE_DATE_EPOCH environment variable See https://reproducible-builds.org/specs/source-date-epoch/
Definition at line 787 of file PEAR.php.
References exit.
Referenced by PEAR_Registry\_addChannel(), PEAR_Registry\_addPackage(), PEAR_Registry\_addPackage2(), PEAR_Registry\_updatePackage(), and PEAR_Registry\_updatePackage2().
|
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!
| string | $class | The calling classname, to prevent clashes |
| string | $var | The variable to retrieve. |
Definition at line 261 of file PEAR.php.
|
static |
Tell whether a value is a PEAR error.
| mixed | $data | the value to test |
| int | $code | if $data is an error object, return true only if $code is a string and $obj->getMessage() == $code or $code is an integer and $obj->getCode() == $code |
Definition at line 306 of file PEAR.php.
Referenced by PEAR_Registry\_addChannel(), PEAR_Builder\_build_win32(), PEAR_Command_Remote\_checkChannelForStatus(), PEAR_Installer\_compileSourceFiles(), PEAR_Downloader\_downloadHttp(), PEAR_Command_Install\_filterUptodatePackages(), PEAR_Registry\_getAlias(), PEAR_Downloader\_getDepPackageDownloadUrl(), PEAR_Downloader\_getPackageDownloadUrl(), PEAR_Registry\_initializeDepDB(), PEAR_Installer\_installFile(), PEAR_Installer\_installFile2(), PEAR_Installer\_parsePackageXml(), PEAR_Common\_postProcessChecks(), PEAR_Registry\addChannel(), PEAR_Registry\addPackage(), PEAR_Registry\addPackage2(), PEAR_Downloader\analyzeDependencies(), PEAR_Builder\build(), PEAR_Registry\channelAlias(), PEAR_Registry\channelExists(), PEAR_Registry\channelInfo(), PEAR_Registry\channelName(), PEAR_Registry\checkFileMap(), PEAR_Registry\deleteChannel(), PEAR_Registry\deletePackage(), PEAR_Common\detectDependencies(), PEAR_Command_Install\disableExtension(), PEAR_Downloader\discover(), PEAR_Command_Channels\doAdd(), PEAR_Command_Channels\doAlias(), PEAR_Command_Build\doBuild(), PEAR_Command_Install\doBundle(), PEAR_Command_Package\doConvert(), PEAR_Command_Package\doCvsDiff(), PEAR_Command_Package\doCvsTag(), PEAR_Command_Channels\doDelete(), PEAR_Command_Channels\doDiscover(), PEAR_Command_Remote\doDownload(), PEAR_Command_Mirror\doDownloadAll(), PEAR_Command_Registry\doFileList(), PEAR_Command_Channels\doInfo(), PEAR_Command_Registry\doInfo(), PEAR_Command_Install\doInstall(), PEAR_Command_Registry\doList(), PEAR_Command_Remote\doListAll(), PEAR_Command_Remote\doListUpgrades(), PEAR_Command_Channels\doLogin(), PEAR_Command_Channels\doLogout(), PEAR_Command_Package\doPackage(), PEAR_Command_Pickle\doPackage(), PEAR_Command_Package\doPackageDependencies(), PEAR_Command_Package\doPackageValidate(), PEAR_Command_Remote\doRemoteInfo(), PEAR_Command_Remote\doRemoteList(), PEAR_Command_Install\doRunScripts(), PEAR_Command_Test\doRunTests(), PEAR_Command_Remote\doSearch(), PEAR_Command_Registry\doShellTest(), PEAR_Command_Package\doSign(), PEAR_Command_Package\doSvnTag(), PEAR_Command_Install\doUninstall(), PEAR_Command_Channels\doUpdate(), PEAR_Command_Channels\doUpdateAll(), PEAR_Command_Install\doUpgradeAll(), PEAR_Downloader\download(), PEAR_Command_Install\enableExtension(), PEAR_Registry\getChannel(), PEAR_Registry\getChannels(), PEAR_Registry\getChannelValidator(), PEAR_Downloader\getDownloadDir(), PEAR_Registry\getPackage(), PEAR_Downloader\getPackageDownloadUrl(), PEAR_Common\infoFromAny(), PEAR_Installer\install(), PEAR_Registry\isAlias(), PEAR_Registry\listAllPackages(), PEAR_Registry\listChannels(), PEAR_Registry\listPackages(), PEAR_Registry\mirrorExists(), PEAR_Packager\package(), PEAR_Registry\packageExists(), PEAR_Registry\packageInfo(), PEAR_Registry\parsePackageName(), PEAR_Downloader\setDownloadDir(), PEAR_Installer\setDownloadedPackages(), PEAR_Installer\sortPackagesForUninstall(), PEAR_Installer\uninstall(), PEAR_Registry\updatePackage(), PEAR_Registry\updatePackage2(), and PEAR_Common\validatePackageInfo().
|
static |
OS independent PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.
| string | $ext | The extension name |
Definition at line 751 of file PEAR.php.
Referenced by Archive_Tar\__construct().
| PEAR | ( | $error_class = null | ) |
Only here for backwards compatibility. E.g. Archive_Tar calls $this->PEAR() in its constructor.
| string | $error_class | Which class to use for error objects, defaults to PEAR_Error. |
Definition at line 194 of file PEAR.php.
| popExpect | ( | ) |
This method pops one element off the expected error codes stack.
Definition at line 431 of file PEAR.php.
Referenced by PEAR_Installer\install().
|
static |
Use this function to register a shutdown method for static classes.
| mixed | $func | The function name (or array of class/method) to call |
| mixed | $args | The arguments to pass to the function |
Definition at line 284 of file PEAR.php.
References $GLOBALS.
|
static |
Definition at line 654 of file PEAR.php.
References $GLOBALS, $options, $stack, PEAR_ERROR_CALLBACK, PEAR_ERROR_DIE, PEAR_ERROR_EXCEPTION, PEAR_ERROR_PRINT, PEAR_ERROR_RETURN, and PEAR_ERROR_TRIGGER.
Referenced by PEAR_Command_Remote\_checkChannelForStatus(), PEAR_Command_Install\_filterUptodatePackages(), PEAR_Downloader\_getDepPackageDownloadUrl(), PEAR_Downloader\_getPackageDownloadUrl(), PEAR_Installer\_parsePackageXml(), PEAR_Command_Channels\doAdd(), PEAR_Command_Install\doBundle(), PEAR_Command_Package\doConvert(), PEAR_Command_Remote\doDownload(), PEAR_Command_Mirror\doDownloadAll(), PEAR_Command_Registry\doFileList(), PEAR_Command_Channels\doInfo(), PEAR_Command_Registry\doInfo(), PEAR_Command_Install\doInstall(), PEAR_Command_Registry\doList(), PEAR_Command_Remote\doListUpgrades(), PEAR_Command_Package\doPackageValidate(), PEAR_Command_Install\doRunScripts(), PEAR_Command_Test\doRunTests(), PEAR_Command_Remote\doSearch(), PEAR_Command_Registry\doShellTest(), PEAR_Command_Install\doUninstall(), PEAR_Command_Channels\doUpdate(), PEAR_Downloader\download(), PEAR_Packager\package(), PEAR_Installer\uninstall(), and PEAR_Common\validatePackageInfo().
|
static |
Definition at line 619 of file PEAR.php.
References $GLOBALS, $options, $stack, PEAR_ERROR_CALLBACK, PEAR_ERROR_DIE, PEAR_ERROR_EXCEPTION, PEAR_ERROR_PRINT, PEAR_ERROR_RETURN, and PEAR_ERROR_TRIGGER.
Referenced by PEAR_Command_Remote\_checkChannelForStatus(), PEAR_Command_Install\_filterUptodatePackages(), PEAR_Downloader\_getDepPackageDownloadUrl(), PEAR_Downloader\_getPackageDownloadUrl(), PEAR_Installer\_parsePackageXml(), PEAR_Downloader\analyzeDependencies(), PEAR_Command_Channels\doAdd(), PEAR_Command_Install\doBundle(), PEAR_Command_Package\doConvert(), PEAR_Command_Remote\doDownload(), PEAR_Command_Mirror\doDownloadAll(), PEAR_Command_Registry\doFileList(), PEAR_Command_Channels\doInfo(), PEAR_Command_Registry\doInfo(), PEAR_Command_Install\doInstall(), PEAR_Command_Registry\doList(), PEAR_Command_Remote\doListUpgrades(), PEAR_Command_Package\doPackageValidate(), PEAR_Command_Install\doRunScripts(), PEAR_Command_Test\doRunTests(), PEAR_Command_Remote\doSearch(), PEAR_Command_Registry\doShellTest(), PEAR_Command_Install\doUninstall(), PEAR_Command_Channels\doUpdate(), PEAR_Command_Channels\doUpdateAll(), PEAR_Downloader\download(), PEAR_Packager\package(), PEAR_Installer\uninstall(), and PEAR_Common\validatePackageInfo().
| $_error_class = 'PEAR_Error' |
|
staticprotected |