public static function exception(\Exception $e) { self::$found = TRUE; // If the view fails, at least we can print this message! $message = "{$e->getMessage()} [{$e->getFile()}] ({$e->getLine()})"; try { log_message($message); self::header(); $view = new View('System/Exception'); $view->exception = $e; print $view; } catch (\Exception $e) { print $message; } exit(1); }
<?php // Include config file /////////////////////////////////////////////////////////////////// require_once "config.php"; require_once "components/core/core_helpers.php"; loadComponents("core/core_render.php", "core/core_error.php", "development/development_helpers.php"); // Initialize Error Handling $e = new CoreError(); // Initialize Render $render = new CoreRender(); // Include Logic /////////////////////////////////////////////////////////////////// // Set Request Variables $controller = req("controller"); $action = req("action"); // Generate standart controller path $post_controller = c("controllers") . $controller . "_controller.php"; // Checks if controller exist in path if (!empty($controller) and file_exists($post_controller) || $controller != "application") { $current_controller = $post_controller; // else use default (which you get from config) } else { // Splits the default route and set new path $default = split("/", c("default")); $current_controller = c("controllers") . $default[0] . "_controller.php"; // Sets controller and action based on defaults $controller = $default[0]; $action = $default[1]; if (!file_exists($current_controller)) { $e->error("default route controller: <b>" . $default[0] . "</b> not found");