<?php //Require the composer autoloader. require dirname(__DIR__) . '/vendor/autoload.php'; //Setup the application \Disco\classes\App::instance()->setUp(); try { //Include the application logic require '../app/index.php'; //Tear down the app App::tearDown(); } catch (\Exception $e) { //************************* // You better handle this! // 500 error for default. //************************* error_log($e->getMessage()); \View::serve(500); } //catch
/** * Add HTML to the view. * * @param string $html HTML to load into the view. */ public function html($html) { \View::html($template); \View::serve(); }
/** * Make sure a \Disco\classes\Router matched against the requested URI, and serve the necessary page. * * * @return void */ public final function tearDown() { /** * did this requested URI not find a match? If so thats a 404. */ if (!\Disco\classes\Router::routeMatch()) { \View::serve(404); } elseif (http_response_code() != 200) { \View::serve(http_response_code()); } else { \View::serve(); } //el }