What?
Bootstrapper is a single access point (
index.php
script located in the web's document root) of the web application.
Its purpose is to handle all incoming requests by 1. setting up the application
environment, 2. routing the request to the correct action controller and 3. dispatching it.
Why?
Easy application configuration (all that is common is in single bootstrapper file).
How?
Setting up the application environment
- set up php environment if necessary (error reporting, include paths,...)
- set up class loader (and register is as autoloader within php)
- load common classes
- load configuration into registry
- setup db and store db handle into registry
- set up caching
- set up front controller
- set up router
- dispatch front controller
Routing the request to the action controller
- set up router
Dispatching the request (dispatch loop)
- dispatch front controller
Links
No comments:
Post a Comment