public function run($url) { // Init $this->init(); // Route $this->pluginLoader->call('route'); // Routing $this->url = $url; $this->callHook('router_beforeroute'); $this->router->run(); $this->callHook('router_afterroute'); $this->callHook('app_endlife'); return true; }
/** * Launches the prerequisites to using the application */ public function run() { require_once ROOT . '/core/autoloader/Autoloader.php'; $paths = (require_once ROOT . '/app/config/paths.php'); $autoloader = new Autoloader($paths); $autoloader->start(); $config = (require ROOT . '/app/config/app.php'); define('DEBUG', Config::get()->read('debug')); if (!DEBUG) { error_reporting(0); } else { ini_set('display_errors', 'on'); error_reporting(E_ALL); } session_cache_expire(Config::get()->read('session')); session_start(); require_once ROOT . '/core/helpers.php'; $router = new Router(isset($_GET['url']) ? $_GET['url'] : null); require_once ROOT . '/app/routes.php'; $this->router = $router; $middleware = new Middleware(); $middleware->load(); $router->run(); }