2009年3月1日星期日

Re: [fw-mvc] Proper use of Zend_Loader_Autoloader_Resource

Matthew Weier O'Phinney wrote:
 Regarding the settings in questions 1, 3, and 4, these could be in a config file as well, and you could simply pass the path to a config file when instantiating Zend_Application. As an example, consider this:      $app = new Zend_Application(         APPLICATION_ENV,          APPLICATION_PATH .  '/configs/site.ini'     );  where APPLICATION_PATH . '/configs/site.ini' reads as follows:      [production]     phpSettings.display_errors = false     phpSettings.error_reporting = 771     autoloaderNamespaces.imagis = "Imagis_"     autoloaderNamespaces.phly = "Phly_"     includePaths.cwd = "."     includePaths.lib = APPLICATION_PATH "/../library"      [development : production]     phpSettings.display_errors = true     phpSettings.error_reporting = 8191  As you can see, this makes the application code simpler, and makes it easier to switch settings per environment (which is also one of the goals of Zend_Application).    
Thanks for replies,

I have one more question:

It is possible to set bootstrap file from config.ini ?

//index.php
$application = new Zend_Application(APPLICATION_ENVIRONMENT, APPLICATION_PATH .  '/config/config.ini' );

//config.ini
bootstrap = APPLICATION_PATH.'/Bootstrap.php'

error:
Warning: require_once(APPLICATION_PATH.'/Bootstrap.php') [function.require-once]: failed to open stream: No such file or directory in D:\_Work\hostexpert2\library\dasprid\Zend\Application.php on line 228

In am encountering error from above when trying to set bootstrap through config file.

--  Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com

没有评论: