Skip to content

Commit

Permalink
Updated about.flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Woody Gilk committed May 16, 2010
1 parent 2a5404e commit 913cad6
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions guide/about.flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

Every application follows the same flow:

1. Application starts from `index.php`
2. Includes `APPPATH/bootstrap.php`
3. The bootstrap calls [Kohana::modules] with a list of modules to use
1. Generates an array of paths for the cascading filesystem
2. Checks each module to see if it has an init.php, and if it does, loads it
* Each init.php can define a series of routes to use, they are loaded when the init.php file is included
4. [Request::instance] called to process the request
1. Checks each route until a match is found
2. Loads controller and passes the request to it
3. Calls the [Controller::before] method
4. Calls the controller action
5. Calls the [Controller::after] method
5. Displays the [Request] response

The controller action can be changed by [Controller::before] based on the request parameters.
1. Application starts from `index.php`.
2. The application, module, and system paths are set.
3. Error reporting levels are set.
4. Install file is loaded, if it exists.
5. The [Kohana] class is loaded.
6. The bootstrap file, `APPPATH/bootstrap.php`, is included.
7. [Kohana::init] is called, which sets up error handling, caching, and logging.
8. [Kohana_Config] readers and [Kohana_Log] writers are attached.
9. [Kohana::modules] is called to enable additional modules.
* Module paths are added to the [cascading filesystem](about.filesystem).
* Includes the module `init.php` file, if it exists.
* The `init.php` file can perform additional environment setup, including adding routes.
10. [Route::set] is called multiple times to define the [application routes](using.routing).
11. [Request::instance] called to start processing the request.
1. Checks each route that has been set until a match is found.
2. Creates the controller instance and passes the request to it.
3. Calls the [Controller::before] method.
4. Calls the controller action, which generates the request response.
5. Calls the [Controller::after] method.
* The above 5 steps can be repeated multiple times when using [HMVC sub-requests](about.mvc).
12. The main [Request] response is displayed

[!!] Stub

0 comments on commit 913cad6

Please sign in to comment.