Every application follows the same flow:
- Application starts from
- The application, module, and system paths are set. (
- Error reporting levels are set.
- Install file is loaded, if it exists.
- The bootstrap file,
APPPATH/bootstrap.php, is included.
- Once we are in
- The Kohana class is loaded.
- Kohana::init is called, which sets up error handling, caching, and logging.
- Kohana_Config readers and Kohana_Log writers are attached.
- Kohana::modules is called to enable additional modules.
- Module paths are added to the cascading filesystem.
- Includes each module's
init.php file, if it exists.
init.php file can perform additional environment setup, including adding routes.
- Route::set is called multiple times to define the application routes.
- Request::factory is called to start processing the request.
- Checks each route that has been set until a match is found.
- Creates the controller instance and passes the request to it.
- Calls the Controller::before method.
- Calls the controller action, which generates the request response.
- Calls the Controller::after method.
- Application flow returns to index.php
- The main Request response is displayed