another. Initially, the environment is set up correctly (#1) to ensure that all errors or notices are displayed.
PHP 5.1 introduced new time and date functionality that needs to know where in the world we are. There are
multiple ways to set this, but the easiest user-land method is date_default_timezone_set().
The Zend Framework is written with the assumption that the library directory is available on the
php_include path. There are multiple ways of doing this and the fastest for a global library is to alter the
include_path setting directly in php.ini. A more portable method, especially if you use multiple versions of the
framework on one server, is to set the include path within the bootstrap as we do here (#2).
The Zend Framework applications does not depend on any particular file, however it is useful to have a
couple of helper classes loaded early. Zend_Loader::loadClass() is used “include” the correct file for the
supplied class name. The function converts the underscores in the class’s name to directory separators and
then, after error checking, includes the file. Hence the code line
Zend_Loader::loadClass('Zend_Controller_Front'); and include_once
'Zend/Controller/Front.php'; have the same end result. Zend_Debug::dump() is used to output
debugging information about a variable by providing a formatted var_dump() output.
The final section of the bootstrap sets up the front controller and then runs it. The front controller class,
Zend_Controller_Front implements the Singleton design pattern (#3). This means that the class definition itself
ensures that there can only be one instance of the object allowed. A Singleton design is appropriate for a front
controller as it ensures that there is only ever one class that is processing the request. One of the consequences
of the Singleton design is that you cannot use the new operator to instantiate it and must, instead, use the
getInstance() static member function. The front controller has a feature that captures all exceptions thrown by
default and stores them into the Response object that it creates. This Response object holds all information
about the response to the requested URL and for HTML applications this is the HTTP headers, the page
content and any exceptions that were thrown. The front controller automatically sends the headers and displays
the page content when it finishes processing the request.
