Bearsampp 2026.9.23
Loading...
Searching...
No Matches
PEAR Class Reference
Inheritance diagram for PEAR:

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

Detailed Description

Definition at line 86 of file PEAR.php.

Constructor & Destructor Documentation

◆ __construct()

__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 160 of file PEAR.php.

161 {
162 $classname = strtolower(get_class($this));
163 if ($this->_debug) {
164 print "PEAR constructor called, class=$classname\n";
165 }
166
167 if ($error_class !== null) {
168 $this->_error_class = $error_class;
169 }
170
171 while ($classname && strcasecmp($classname, "pear")) {
172 $destructor = "_$classname";
173 if (method_exists($this, $destructor)) {
174 global $_PEAR_destructor_object_list;
175 $_PEAR_destructor_object_list[] = $this;
176 if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
177 register_shutdown_function("_PEAR_call_destructors");
178 $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
179 }
180 break;
181 } else {
182 $classname = get_parent_class($classname);
183 }
184 }
185 }
$GLOBALS['_PEAR_default_error_mode']
Definition PEAR.php:46

References $GLOBALS.

Member Function Documentation

◆ __call()

__call ( $method,
$arguments )

Definition at line 216 of file PEAR.php.

217 {
218 if (!isset(self::$bivalentMethods[$method])) {
219 if (PHP_VERSION_ID < 70000) {
220 trigger_error(
221 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR
222 );
223 } else {
224 throw new Error('Call to undefined method PEAR::' . $method . '()');
225 }
226 }
227 return call_user_func_array(
228 array(__CLASS__, '_' . $method),
229 array_merge(array($this), $arguments)
230 );
231 }
if(!extension_loaded('winbinder')) if(!dl('php_winbinder.dll')) trigger_error("WinBinder extension could not be loaded.\n" E_USER_ERROR
Definition winbinder.php:14

References E_USER_ERROR.

◆ __callStatic()

__callStatic ( $method,
$arguments )
static

Definition at line 233 of file PEAR.php.

234 {
235 if (!isset(self::$bivalentMethods[$method])) {
236 if (PHP_VERSION_ID < 70000) {
237 trigger_error(
238 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR
239 );
240 } else {
241 throw new Error('Call to undefined method PEAR::' . $method . '()');
242 }
243 }
244 return call_user_func_array(
245 array(__CLASS__, '_' . $method),
246 array_merge(array(null), $arguments)
247 );
248 }

References E_USER_ERROR.

◆ _checkDelExpect()

_checkDelExpect ( $error_code)

This method checks unsets an error code if available

Parameters
mixederror code
Returns
bool true if the error code was unset, false otherwise @access private
Since
PHP 4.3.0

Definition at line 444 of file PEAR.php.

445 {
446 $deleted = false;
447 foreach ($this->_expected_errors as $key => $error_array) {
448 if (in_array($error_code, $error_array)) {
449 unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
450 $deleted = true;
451 }
452
453 // clean up empty arrays
454 if (0 == count($this->_expected_errors[$key])) {
455 unset($this->_expected_errors[$key]);
456 }
457 }
458
459 return $deleted;
460 }

Referenced by delExpect().

Here is the caller graph for this function:

◆ _PEAR()

_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 210 of file PEAR.php.

210 {
211 if ($this->_debug) {
212 printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
213 }
214 }

◆ _popErrorHandling()

_popErrorHandling ( $object)
staticprotected

Pop the last error handler used

Returns
bool Always true
See also
PEAR::pushErrorHandling

Definition at line 730 of file PEAR.php.

731 {
732 $stack = &$GLOBALS['_PEAR_error_handler_stack'];
733 array_pop($stack);
734 list($mode, $options) = $stack[sizeof($stack) - 1];
735 array_pop($stack);
736 if ($object !== null) {
737 $object->setErrorHandling($mode, $options);
738 } else {
739 PEAR::setErrorHandling($mode, $options);
740 }
741 return true;
742 }
$stack
$options
Definition pearcmd.php:145

References $GLOBALS, $options, and $stack.

◆ _pushErrorHandling()

_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 702 of file PEAR.php.

703 {
704 $stack = &$GLOBALS['_PEAR_error_handler_stack'];
705 if ($object !== null) {
706 $def_mode = &$object->_default_error_mode;
707 $def_options = &$object->_default_error_options;
708 } else {
709 $def_mode = &$GLOBALS['_PEAR_default_error_mode'];
710 $def_options = &$GLOBALS['_PEAR_default_error_options'];
711 }
712 $stack[] = array($def_mode, $def_options);
713
714 if ($object !== null) {
715 $object->setErrorHandling($mode, $options);
716 } else {
717 PEAR::setErrorHandling($mode, $options);
718 }
719 $stack[] = array($mode, $options);
720 return true;
721 }

References $GLOBALS, $options, and $stack.

◆ _raiseError()

_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$messagea text error message or a PEAR error object
int$codea numeric error code (it is up to your class to define these if you want to use codes)
int$modeOne of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
mixed$optionsIf $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$userinfoIf you need to pass along for example debug information, this parameter is meant for that.
string$error_classThe returned error object will be instantiated from this class, if specified.
bool$skipmsgIf 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 531 of file PEAR.php.

539 {
540 // The error is yet a PEAR error object
541 if (is_object($message)) {
542 $code = $message->getCode();
543 $userinfo = $message->getUserInfo();
544 $error_class = $message->getType();
545 $message->error_message_prefix = '';
546 $message = $message->getMessage();
547 }
548
549 if (
550 $object !== null &&
551 isset($object->_expected_errors) &&
552 count($object->_expected_errors) > 0 &&
553 count($exp = end($object->_expected_errors))
554 ) {
555 if ($exp[0] === "*" ||
556 (is_int(reset($exp)) && in_array($code, $exp)) ||
557 (is_string(reset($exp)) && in_array($message, $exp))
558 ) {
559 $mode = PEAR_ERROR_RETURN;
560 }
561 }
562
563 // No mode given, try global ones
564 if ($mode === null) {
565 // Class error handler
566 if ($object !== null && isset($object->_default_error_mode)) {
567 $mode = $object->_default_error_mode;
568 $options = $object->_default_error_options;
569 // Global error handler
570 } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
571 $mode = $GLOBALS['_PEAR_default_error_mode'];
572 $options = $GLOBALS['_PEAR_default_error_options'];
573 }
574 }
575
576 if ($error_class !== null) {
577 $ec = $error_class;
578 } elseif ($object !== null && isset($object->_error_class)) {
579 $ec = $object->_error_class;
580 } else {
581 $ec = 'PEAR_Error';
582 }
583
584 if ($skipmsg) {
585 $a = new $ec($code, $mode, $options, $userinfo);
586 } else {
587 $a = new $ec($message, $code, $mode, $options, $userinfo);
588 }
589
590 return $a;
591 }
const PEAR_ERROR_RETURN
Definition PEAR.php:24

References $GLOBALS, $options, and PEAR_ERROR_RETURN.

◆ _setErrorHandling()

_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$objectObject the method was called on (non-static mode)
int$modeOne of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
mixed$optionsWhen $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 362 of file PEAR.php.

364 {
365 if ($object !== null) {
366 $setmode = &$object->_default_error_mode;
367 $setoptions = &$object->_default_error_options;
368 } else {
369 $setmode = &$GLOBALS['_PEAR_default_error_mode'];
370 $setoptions = &$GLOBALS['_PEAR_default_error_options'];
371 }
372
373 switch ($mode) {
376 case PEAR_ERROR_PRINT:
378 case PEAR_ERROR_DIE:
379 case null:
380 $setmode = $mode;
381 $setoptions = $options;
382 break;
383
385 $setmode = $mode;
386 // class/object method callback
387 if (is_callable($options)) {
388 $setoptions = $options;
389 } else {
390 trigger_error("invalid error callback", E_USER_WARNING);
391 }
392 break;
393
394 default:
395 trigger_error("invalid error mode", E_USER_WARNING);
396 break;
397 }
398 }
const PEAR_ERROR_PRINT
Definition PEAR.php:25
const PEAR_ERROR_TRIGGER
Definition PEAR.php:26
const PEAR_ERROR_EXCEPTION
Definition PEAR.php:33
const PEAR_ERROR_CALLBACK
Definition PEAR.php:28
const PEAR_ERROR_DIE
Definition PEAR.php:27

References $GLOBALS, $options, PEAR_ERROR_CALLBACK, PEAR_ERROR_DIE, PEAR_ERROR_EXCEPTION, PEAR_ERROR_PRINT, PEAR_ERROR_RETURN, and PEAR_ERROR_TRIGGER.

◆ _throwError()

_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$messagea text error message or a PEAR error object
int$codea numeric error code (it is up to your class to define these if you want to use codes)
string$userinfoIf 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 608 of file PEAR.php.

609 {
610 if ($object !== null) {
611 $a = $object->raiseError($message, $code, null, null, $userinfo);
612 return $a;
613 }
614
615 $a = PEAR::raiseError($message, $code, null, null, $userinfo);
616 return $a;
617 }

◆ delExpect()

delExpect ( $error_code)

This method deletes all occurrences of the specified element from the expected error codes stack.

Parameters
mixed$error_codeerror 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 471 of file PEAR.php.

472 {
473 $deleted = false;
474 if ((is_array($error_code) && (0 != count($error_code)))) {
475 // $error_code is a non-empty array here; we walk through it trying
476 // to unset all values
477 foreach ($error_code as $key => $error) {
478 $deleted = $this->_checkDelExpect($error) ? true : false;
479 }
480
481 return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
482 } elseif (!empty($error_code)) {
483 // $error_code comes alone, trying to unset it
484 if ($this->_checkDelExpect($error_code)) {
485 return true;
486 }
487
488 return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
489 }
490
491 // $error_code is empty
492 return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
493 }
_checkDelExpect($error_code)
Definition PEAR.php:444

References _checkDelExpect().

Here is the call graph for this function:

◆ expectError()

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$codea 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 415 of file PEAR.php.

416 {
417 if (is_array($code)) {
418 array_push($this->_expected_errors, $code);
419 } else {
420 array_push($this->_expected_errors, array($code));
421 }
422 return count($this->_expected_errors);
423 }

Referenced by PEAR_Installer\install().

Here is the caller graph for this function:

◆ getSourceDateEpoch()

getSourceDateEpoch ( )
static

Get SOURCE_DATE_EPOCH environment variable See https://reproducible-builds.org/specs/source-date-epoch/

Returns
int @access public

Definition at line 787 of file PEAR.php.

788 {
789 if ($source_date_epoch = getenv('SOURCE_DATE_EPOCH')) {
790 if (preg_match('/^\d+$/', $source_date_epoch)) {
791 return (int) $source_date_epoch;
792 } else {
793 // "If the value is malformed, the build process SHOULD exit with a non-zero error code."
794 self::raiseError("Invalid SOURCE_DATE_EPOCH: $source_date_epoch");
795 exit(1);
796 }
797 } else {
798 return time();
799 }
800 }

References exit.

Referenced by PEAR_Registry\_addChannel(), PEAR_Registry\_addPackage(), PEAR_Registry\_addPackage2(), PEAR_Registry\_updatePackage(), and PEAR_Registry\_updatePackage2().

Here is the caller graph for this function:

◆ getStaticProperty()

& 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$classThe calling classname, to prevent clashes
string$varThe variable to retrieve.
Returns
mixed A reference to the variable. If not set it will be auto initialised to NULL.

Definition at line 261 of file PEAR.php.

262 {
263 static $properties;
264 if (!isset($properties[$class])) {
265 $properties[$class] = array();
266 }
267
268 if (!array_key_exists($var, $properties[$class])) {
269 $properties[$class][$var] = null;
270 }
271
272 return $properties[$class][$var];
273 }

◆ isError()

isError ( $data,
$code = null )
static

Tell whether a value is a PEAR error.

Parameters
mixed$datathe value to test
int$codeif $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
Returns
bool true if parameter is an error

Definition at line 306 of file PEAR.php.

307 {
308 if (!is_a($data, 'PEAR_Error')) {
309 return false;
310 }
311
312 if (is_null($code)) {
313 return true;
314 } elseif (is_string($code)) {
315 return $data->getMessage() == $code;
316 }
317
318 return $data->getCode() == $code;
319 }

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().

◆ loadExtension()

loadExtension ( $ext)
static

OS independent PHP extension load. Remember to take care on the correct extension name for case sensitive OSes.

Parameters
string$extThe extension name
Returns
bool Success or not on the dl() call

Definition at line 751 of file PEAR.php.

752 {
753 if (extension_loaded($ext)) {
754 return true;
755 }
756
757 // if either returns true dl() will produce a FATAL error, stop that
758 if (
759 function_exists('dl') === false ||
760 ini_get('enable_dl') != 1
761 ) {
762 return false;
763 }
764
765 if (OS_WINDOWS) {
766 $suffix = '.dll';
767 } elseif (PHP_OS == 'HP-UX') {
768 $suffix = '.sl';
769 } elseif (PHP_OS == 'AIX') {
770 $suffix = '.a';
771 } elseif (PHP_OS == 'OSX') {
772 $suffix = '.bundle';
773 } else {
774 $suffix = '.so';
775 }
776
777 return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
778 }

Referenced by Archive_Tar\__construct().

Here is the caller graph for this function:

◆ PEAR()

PEAR ( $error_class = null)

Only here for backwards compatibility. E.g. Archive_Tar calls $this->PEAR() in its constructor.

Parameters
string$error_classWhich class to use for error objects, defaults to PEAR_Error.

Definition at line 194 of file PEAR.php.

195 {
196 self::__construct($error_class);
197 }

◆ popExpect()

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 431 of file PEAR.php.

432 {
433 return array_pop($this->_expected_errors);
434 }

Referenced by PEAR_Installer\install().

Here is the caller graph for this function:

◆ registerShutdownFunc()

registerShutdownFunc ( $func,
$args = array() )
static

Use this function to register a shutdown method for static classes.

Parameters
mixed$funcThe function name (or array of class/method) to call
mixed$argsThe arguments to pass to the function
Returns
void

Definition at line 284 of file PEAR.php.

285 {
286 // if we are called statically, there is a potential
287 // that no shutdown func is registered. Bug #6445
288 if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
289 register_shutdown_function("_PEAR_call_destructors");
290 $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
291 }
292 $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
293 }

References $GLOBALS.

◆ staticPopErrorHandling()

staticPopErrorHandling ( )
static

Definition at line 654 of file PEAR.php.

655 {
656 $stack = &$GLOBALS['_PEAR_error_handler_stack'];
657 $setmode = &$GLOBALS['_PEAR_default_error_mode'];
658 $setoptions = &$GLOBALS['_PEAR_default_error_options'];
659 array_pop($stack);
660 list($mode, $options) = $stack[sizeof($stack) - 1];
661 array_pop($stack);
662 switch ($mode) {
665 case PEAR_ERROR_PRINT:
667 case PEAR_ERROR_DIE:
668 case null:
669 $setmode = $mode;
670 $setoptions = $options;
671 break;
672
674 $setmode = $mode;
675 // class/object method callback
676 if (is_callable($options)) {
677 $setoptions = $options;
678 } else {
679 trigger_error("invalid error callback", E_USER_WARNING);
680 }
681 break;
682
683 default:
684 trigger_error("invalid error mode", E_USER_WARNING);
685 break;
686 }
687 return true;
688 }

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().

Here is the caller graph for this function:

◆ staticPushErrorHandling()

staticPushErrorHandling ( $mode,
$options = null )
static

Definition at line 619 of file PEAR.php.

620 {
621 $stack = &$GLOBALS['_PEAR_error_handler_stack'];
622 $def_mode = &$GLOBALS['_PEAR_default_error_mode'];
623 $def_options = &$GLOBALS['_PEAR_default_error_options'];
624 $stack[] = array($def_mode, $def_options);
625 switch ($mode) {
628 case PEAR_ERROR_PRINT:
630 case PEAR_ERROR_DIE:
631 case null:
632 $def_mode = $mode;
633 $def_options = $options;
634 break;
635
637 $def_mode = $mode;
638 // class/object method callback
639 if (is_callable($options)) {
640 $def_options = $options;
641 } else {
642 trigger_error("invalid error callback", E_USER_WARNING);
643 }
644 break;
645
646 default:
647 trigger_error("invalid error mode", E_USER_WARNING);
648 break;
649 }
650 $stack[] = array($mode, $options);
651 return true;
652 }

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().

Here is the caller graph for this function:

Field Documentation

◆ $_debug

$_debug = false

Definition at line 94 of file PEAR.php.

◆ $_default_error_handler

$_default_error_handler = ''

Definition at line 120 of file PEAR.php.

◆ $_default_error_mode

$_default_error_mode = null

Definition at line 102 of file PEAR.php.

◆ $_default_error_options

$_default_error_options = null

Definition at line 111 of file PEAR.php.

◆ $_error_class

$_error_class = 'PEAR_Error'

Definition at line 128 of file PEAR.php.

◆ $_expected_errors

$_expected_errors = array()

Definition at line 136 of file PEAR.php.

◆ $bivalentMethods

$bivalentMethods
staticprotected
Initial value:
= array(
'setErrorHandling' => true,
'raiseError' => true,
'throwError' => true,
'pushErrorHandling' => true,
'popErrorHandling' => true,
)

Definition at line 142 of file PEAR.php.


The documentation for this class was generated from the following file:
  • E:/Bearsampp-development/sandbox/core/libs/php/pear/pear/PEAR.php