X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=WEB-INF%2Flib%2Fpear%2FPEAR%2FErrorStack.php;h=7b705bdbbad486f320b2f256f977bb4e247fd5da;hb=90ff65cf45284f90b1c4e09fe575319b320f56ac;hp=0303f5273adb45d68c77368ac99bd1910e1d4edd;hpb=afe2d051307ae2cd54bdb957f04e1d9f625f2dd9;p=timetracker.git diff --git a/WEB-INF/lib/pear/PEAR/ErrorStack.php b/WEB-INF/lib/pear/PEAR/ErrorStack.php index 0303f527..7b705bdb 100644 --- a/WEB-INF/lib/pear/PEAR/ErrorStack.php +++ b/WEB-INF/lib/pear/PEAR/ErrorStack.php @@ -23,7 +23,6 @@ * @author Greg Beaver * @copyright 2004-2008 Greg Beaver * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR_ErrorStack */ @@ -132,12 +131,11 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2); * $local_stack = new PEAR_ErrorStack('MyPackage'); * * @author Greg Beaver - * @version 1.9.4 + * @version 1.10.1 * @package PEAR_ErrorStack * @category Debugging * @copyright 2004-2008 Greg Beaver * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR_ErrorStack */ class PEAR_ErrorStack { @@ -194,43 +192,43 @@ class PEAR_ErrorStack { * @access protected */ var $_contextCallback = false; - + /** * If set to a valid callback, this will be called every time an error * is pushed onto the stack. The return value will be used to determine * whether to allow an error to be pushed or logged. - * + * * The return value must be one an PEAR_ERRORSTACK_* constant * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @var false|string|array * @access protected */ var $_errorCallback = array(); - + /** * PEAR::Log object for logging errors * @var false|Log * @access protected */ var $_logger = false; - + /** * Error messages - designed to be overridden * @var array * @abstract */ var $_errorMsgs = array(); - + /** * Set up a new error stack - * + * * @param string $package name of the package this error stack represents * @param callback $msgCallback callback used for error message generation * @param callback $contextCallback callback used for context generation, * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error */ - function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false, + function __construct($package, $msgCallback = false, $contextCallback = false, $throwPEAR_Error = false) { $this->_package = $package; @@ -250,12 +248,13 @@ class PEAR_ErrorStack { * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error * @param string $stackClass class to instantiate - * @static + * * @return PEAR_ErrorStack */ - function &singleton($package, $msgCallback = false, $contextCallback = false, - $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack') - { + public static function &singleton( + $package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack' + ) { if (isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; } @@ -297,15 +296,14 @@ class PEAR_ErrorStack { /** * Set up a PEAR::Log object for all error stacks that don't have one * @param Log $log - * @static */ - function setDefaultLogger(&$log) + public static function setDefaultLogger(&$log) { if (is_object($log) && method_exists($log, 'log') ) { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; } elseif (is_callable($log)) { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; - } + } } /** @@ -358,9 +356,8 @@ class PEAR_ErrorStack { * messages for a singleton * @param array|string Callback function/method * @param string Package name, or false for all packages - * @static */ - function setDefaultCallback($callback = false, $package = false) + public static function setDefaultCallback($callback = false, $package = false) { if (!is_callable($callback)) { $callback = false; @@ -432,9 +429,8 @@ class PEAR_ErrorStack { * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @see staticPopCallback(), pushCallback() * @param string|array $cb - * @static */ - function staticPushCallback($cb) + public static function staticPushCallback($cb) { array_push($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'], $cb); } @@ -443,9 +439,8 @@ class PEAR_ErrorStack { * Remove a temporary overriding error callback * @see staticPushCallback() * @return array|string|false - * @static */ - function staticPopCallback() + public static function staticPopCallback() { $ret = array_pop($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK']); if (!is_array($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'])) { @@ -604,11 +599,11 @@ class PEAR_ErrorStack { * to find error context * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also * thrown. see docs for {@link push()} - * @static */ - function staticPush($package, $code, $level = 'error', $params = array(), - $msg = false, $repackage = false, $backtrace = false) - { + public static function staticPush( + $package, $code, $level = 'error', $params = array(), + $msg = false, $repackage = false, $backtrace = false + ) { $s = &PEAR_ErrorStack::singleton($package); if ($s->_contextCallback) { if (!$backtrace) { @@ -750,9 +745,8 @@ class PEAR_ErrorStack { * @param string|false Package name to check for errors * @param string Level name to check for a particular severity * @return boolean - * @static */ - function staticHasErrors($package = false, $level = false) + public static function staticHasErrors($package = false, $level = false) { if ($package) { if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { @@ -776,12 +770,13 @@ class PEAR_ErrorStack { * @param boolean $merge Set to return a flat array, not organized by package * @param array $sortfunc Function used to sort a merged array - default * sorts by time, and should be good for most cases - * @static + * * @return array */ - function staticGetErrors($purge = false, $level = false, $merge = false, - $sortfunc = array('PEAR_ErrorStack', '_sortErrors')) - { + public static function staticGetErrors( + $purge = false, $level = false, $merge = false, + $sortfunc = array('PEAR_ErrorStack', '_sortErrors') + ) { $ret = array(); if (!is_callable($sortfunc)) { $sortfunc = array('PEAR_ErrorStack', '_sortErrors'); @@ -806,7 +801,7 @@ class PEAR_ErrorStack { * Error sorting function, sorts by time * @access private */ - function _sortErrors($a, $b) + public static function _sortErrors($a, $b) { if ($a['time'] == $b['time']) { return 0; @@ -829,9 +824,8 @@ class PEAR_ErrorStack { * @param unused * @param integer backtrace frame. * @param array Results of debug_backtrace() - * @static */ - function getFileLine($code, $params, $backtrace = null) + public static function getFileLine($code, $params, $backtrace = null) { if ($backtrace === null) { return false; @@ -903,10 +897,10 @@ class PEAR_ErrorStack { * @param PEAR_ErrorStack * @param array * @param string|false Pre-generated error message template - * @static + * * @return string */ - function getErrorMessage(&$stack, $err, $template = false) + public static function getErrorMessage(&$stack, $err, $template = false) { if ($template) { $mainmsg = $template;