Bootstrapping PHP application


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.


Easy application configuration (all that is common is in single bootstrapper file).


Setting up the application environment
  1. set up php environment if necessary (error reporting, include paths,...)
  2. set up class loader (and register is as autoloader within php)
  3. load common classes
  4. load configuration into registry
  5. setup db and store db handle into registry
  6. set up caching
  7. set up front controller
  8. set up router
  9. dispatch front controller
Routing the request to the action controller
  1. set up router
Dispatching the request (dispatch loop)
  1. dispatch front controller


No comments: