Hello,
I have the below code from a Zend Tutorial illustrating how to initialize an
application based on MVC pattern.
(http://www.zftutorials.com/introduction-zend-framework/Zend-Framework-Getting-Started-Screencasts-l219.html)
But what I don't understand is that every request on the web site will, I
think, execute the initialization code.
Isn' it better to load this code only once ? Or does this code need to be
executed on every request ?
Thank you.
(I am JSP developer and in a j2ee app I would rather initialise the
application in a load-on-startup servlet.)
<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 'on');
ini_set('include_path', ini_get('include_path') . ';../library');
require "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Loader::loadClass('Zend_Config_Xml');
$config = new Zend_Config_Xml('../application/config/config.xml','dev');
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory('../application/controllers');
if($config->test)
$front->throwExceptions(true);
$front->dispatch();
?>
--
View this message in context:
http://www.nabble.com/Beginner---Initializing-application-question-tf4425603s16154.html#a12624413
Sent from the Zend Framework mailing list archive at Nabble.com.