示例#1
0
 public function __destruct()
 {
     $this->restore();
     if (static::$error_handler) {
         set_error_handler(static::$error_handler);
     }
     static::$error_handler = null;
     foreach ($this->stream_overrides as $e) {
         if ($e->isOpen()) {
             $e->closeResource();
         }
     }
 }
示例#2
0
 /**
  * Specifies the function to execute in the event of an error being triggered during a call to Yolk::run().
  * @param callable $handler
  * @return void
  */
 public static function setErrorHandler(callable $handler = null)
 {
     static::$error_handler = $handler ?: ['\\yolk\\exceptions\\Handler', 'error'];
 }