// Start the main execution! // Top-level try/catch block for a last-ditch effort error page. // try { // Initialize the system RPG::setConfig($config); RPG_Template::setPath($config['viewPath']); RPG_Model::setPath($config['modelPath']); RPG::session(); RPG::user(RPG::model('user')); // add this now, so controllers can include CSS that overrides defaults RPG::view()->addStyleSheet('media/styles/light.css'); // Process the request RPG::router($config['controllerPath'])->processRequest(); // stop the timer - needs to be here so it can get rendered via templates RPG::debug('Execution Time (pre-render): ' . round(microtime(true) - RPG::get('__debug_time'), 4)); // Render the output - TODO: handle styles differently later RPG::view()->render(); } catch (RPG_Exception $ex) { // Basic error page echo '<html> <head> <title>Application Error</title> <style type="text/css"> body { font-family: sans-serif; } </style> </head> <body> <h1>Application Error</h1>', "\n"; if (isset($config['debug']) and $config['debug'] === true) { echo $ex;