Пример #1
0
 public static function unstackErrors()
 {
     $level = array_pop(self::$stackedErrorLevels);
     if (null !== $level) {
         $e = error_reporting($level);
         if ($e !== ($level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR)) {
             error_reporting($e);
         }
     }
     if (empty(self::$stackedErrorLevels)) {
         $errors = self::$stackedErrors;
         self::$stackedErrors = array();
         $errorHandler = set_error_handler('var_dump');
         restore_error_handler();
         if ($errorHandler) {
             foreach ($errors as $e) {
                 call_user_func_array($errorHandler, $e);
             }
         }
     }
 }
Пример #2
0
 /**
  * Unstacks stacked errors and forwards to the logger
  */
 public static function unstackErrors()
 {
     $level = array_pop(self::$stackedErrorLevels);
     if (null !== $level) {
         $e = error_reporting($level);
         if ($e !== ($level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR)) {
             // If the user changed the error level, do not overwrite it
             error_reporting($e);
         }
     }
     if (empty(self::$stackedErrorLevels)) {
         $errors = self::$stackedErrors;
         self::$stackedErrors = array();
         foreach ($errors as $e) {
             $e[0][0]->log($e[0][1], $e[1], $e[2]);
         }
     }
 }
 public static function unstackErrors()
 {
     $level = array_pop(self::$stackedErrorLevels);
     if (null !== $level) {
         $e = error_reporting($level);
         if ($e !== ($level | E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR)) {
             error_reporting($e);
         }
     }
     if (empty(self::$stackedErrorLevels)) {
         $errors = self::$stackedErrors;
         self::$stackedErrors = array();
         foreach ($errors as $e) {
             $e[0]->log($e[1], $e[2], $e[3]);
         }
     }
 }
Пример #4
0
 public static function setLogger(LoggerInterface $logger)
 {
     self::$logger = $logger;
 }