Exemplo n.º 1
0
 public function defaultHandle($request, $context)
 {
     $self = $this;
     $error = null;
     set_error_handler(function ($errno, $errstr, $errfile, $errline) use(&$error, $self, $context) {
         if ($self->isDebugEnabled()) {
             $errstr .= " in {$errfile} on line {$errline}";
         }
         $err = $self->getErrorTypeString($errno) . ": " . $errstr;
         if ($errno == E_USER_ERROR || $errno == E_COMPILE_ERROR || $errno == E_CORE_ERROR || $errno == E_ERROR || $errno == E_PARSE) {
             $err .= ob_get_clean();
         }
         $error = $self->sendError($err, $context);
     }, $this->error_types);
     ob_start();
     ob_implicit_flush(0);
     $result = parent::defaultHandle($request, $context);
     ob_end_clean();
     restore_error_handler();
     return $error === null ? $result : $error;
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $this->timer = new Timer($this);
 }