Source for file Bootstrap.php
Documentation is available at Bootstrap.php
require_once 'Zend/Loader.php';
/* -------------------------------------------------------------------------- */
/* Module : Bootstrap.php */
/* Date Vsn Author Description */
/* -------------------------------------------------------------------------- */
/* 18/02/09 1.0 S.Lindo Initial version. */
/* -------------------------------------------------------------------------- */
* Sets up the front controller and the environment (database access, registry variables etc).
public static $frontController =
null;
* Call each necessary function to set up the environment
public static function run()
Zend_Loader::registerAutoload();
self::setupEnvironment();
$response =
self::$frontController->dispatch();
self::sendResponse($response);
* Setup configuration details for the database access and registry
$config =
new Zend_Config_Ini('../application/config/config.ini', 'production');
define('REQUIRED_INDICATOR', $config->required_indicator);
define('CURRENCY_INDICATOR', $config->currency_indicator);
define('CONTACT_US', $config->contact_us);
$registry =
Zend_Registry::getInstance();
$registry->set('config', $config);
$db =
Zend_Db::factory($config->db);
Zend_Db_Table::setDefaultAdapter($db);
//$db->getProfiler()->setEnabled(false);
$db->getProfiler()->setEnabled(true);
require
'Session_Wrapper.php';
if ( $session->get('start_of_month') ==
null)
* Setup the front controller and view parts of the MVC pattern
self::setupFrontController();
* Setup the front controller
self::$frontController =
Zend_Controller_Front::getInstance();
self::$frontController->throwExceptions(true);
self::$frontController->returnResponse(true);
self::$frontController->setControllerDirectory
dirname( __FILE__
) .
'/controllers'
Zend_Controller_Action_HelperBroker::addPath(
Zend_Controller_Action_HelperBroker::addPath(
// LAYOUT SETUP - Setup the layout component
// The Zend_Layout component implements a composite (or two-step-view)
// pattern. With this call we are telling the component where to find
// VIEW SETUP - Initialize properties of the view object
// The Zend_View component is used for rendering views. Here, we grab
// a "global" view instance from the layout object, and specify the
// doctype we wish to use. In this case, XHTML1 Strict.
$view =
Zend_Layout::getMvcInstance()->getView();
$view->doctype('XHTML1_STRICT');
* Setup the page content type and send the HTTP response
public static function sendResponse(Zend_Controller_Response_Http $response)
$response->setHeader('Content-Type', 'text/html; charset=UTF-8', true);
$response->sendResponse();
* Temporary functions to be removed once testing is complete.
* During the conversion from PHP4 to PHP5, these functions were retained to
* ease the transition. From a purist point of view, they should ultimately be
* removed and all references to them elsewhere amended/deleted.
echo
"<BR><FONT color=red><B>" .
basename(__FILE__
) .
" - $in</B></FONT>";
* Temporary function to be removed once testing is complete.
* @deprecated Temporary function to be removed once testing is complete.
* @deprecated Temporary function to be removed once testing is complete.
* @deprecated Temporary function to be removed once testing is complete.
* @deprecated Temporary function to be removed once testing is complete.
echo
"<BR><FONT color=blue>Creating a new $in</FONT>";
require
("../application/models/".
$in.
".inc");
* @deprecated Temporary function to be removed once testing is complete.
echo
"<BR><FONT color=blue>Creating new helper$in</FONT>";
require
("../application/views/helpers/".
$in.
".php");
Documentation generated on Fri, 27 Mar 2009 13:48:23 +0000 by phpDocumentor 1.4.1