Beispiel #1
0
    require_once SYS_PATH . 'file' . EXT;
    Exception\Handler::make($e)->handle();
});
set_error_handler(function ($number, $error, $file, $line) {
    require_once SYS_PATH . 'exception/handler' . EXT;
    require_once SYS_PATH . 'exception/examiner' . EXT;
    require_once SYS_PATH . 'file' . EXT;
    Exception\Handler::make(new \ErrorException($error, $number, 0, $file, $line))->handle();
});
register_shutdown_function(function () {
    if (!is_null($error = error_get_last())) {
        require_once SYS_PATH . 'exception/handler' . EXT;
        require_once SYS_PATH . 'exception/examiner' . EXT;
        require_once SYS_PATH . 'file' . EXT;
        extract($error);
        Exception\Handler::make(new \ErrorException($message, $type, 0, $file, $line))->handle();
    }
});
// --------------------------------------------------------------
// Set the default timezone.
// --------------------------------------------------------------
date_default_timezone_set(Config::get('application.timezone'));
// --------------------------------------------------------------
// Load the session.
// --------------------------------------------------------------
if (Config::get('session.driver') != '') {
    Session::load(Cookie::get('laravel_session'));
}
// --------------------------------------------------------------
// Load all of the core routing classes.
// --------------------------------------------------------------
Beispiel #2
0
 /**
  * Get the parsed content of the view.
  *
  * @return string
  */
 public function get()
 {
     $view = str_replace('.', '/', $this->view);
     if (!file_exists($this->path . $view . EXT)) {
         Exception\Handler::make(new \Exception("View [{$view}] does not exist."))->handle();
     }
     foreach ($this->data as &$data) {
         if ($data instanceof View or $data instanceof Response) {
             $data = (string) $data;
         }
     }
     ob_start() and extract($this->data, EXTR_SKIP);
     try {
         include $this->path . $view . EXT;
     } catch (\Exception $e) {
         Exception\Handler::make($e)->handle();
     }
     return ob_get_clean();
 }