Request Life Cycle

All requests to the application are handled through public/index.php with the exceptions of files in the public directory, Apache is in charge of serving those.

Below you will see the index.php file that ships with Disco, that is really all there is to running the app.

<?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

The setup method of App preps the app by:

The teardown method of the App serves the current View if necessary.