Bootstrapping

The bootstrap does most of the heavy lifting before delegating the page-specific functionality to a controller. It also includes all the core files needed by Phork. It's instantiated and run from the front controller (index.php).

The bootstrap's constructor sets up the include paths for the site components, loads the configuration files, loads the language translations if applicable, and then loads any other global libraries such as the database and the cache objects. Then it sets up the error handler and the debugger, parses the URL, and starts the session if applicable.

When the bootstrap is run() it runs any hooks that have been registered, determines which controller to use and initializes and runs that controller.

Extending the Bootstrap

The default bootstrap is CoreBootstrap. Any changes that you need to the boostrap should be done in AppBootstrap or a site-specific extension of CoreBootstrap such as phork/sites/[sitetype]/bootstraps/SiteBootstrap.class.php.