-- Steve Reed <imstevier...@hotmail.com> wrote (on Thursday, 23 April 2009, 09:16 AM -0700): > Matthew Weier O'Phinney-3 wrote: > > > > Zend_Tool generates a public/index.php file, an > > application/Bootstrap.php file, and an > > application/configs/application.ini file. public/index.php pulls in > > Zend_Application, and passes it the path to the configuration file, > > which indicates the include paths and path to the bootstrap class file. > > > > Forgive me if I'm missing something obvious here but if I set up my > index.php and application.ini exactly how it specifies in the manual, I'll > get a fatal error as the Zend/Application.php file cannot be located due to > the path to the Zend library being added to the include_path by > Zend_Application. I've always set the include_path to the Zend library > (which always resides in my project/library directory) in my index.php like > so: > > ----------------------------------------------------------------------------------------------------- > define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); > define('LIBRARY_PATH', realpath(APPLICATION_PATH . '/../library')); > > defined('APPLICATION_ENV') > || define('APPLICATION_ENV', > (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : > 'production')); > > set_include_path(implode(PATH_SEPARATOR, array( > LIBRARY_PATH, > get_include_path() > ))); > > require_once 'Zend/Application.php'; > > $application = new Zend_Application( > APPLICATION_ENV, > APPLICATION_PATH . '/configs/application.ini' > ); > $application->bootstrap(); > $application->run(); > ----------------------------------------------------------------------------------------------------- > > Is the set_include_path call above somehow redunant like it suggests in the > manual? My include_path setting in php.ini is just ".". Using Zend_Tool to > create a project skeleton might answer my question but, as Rob Allen posted, > it's failing in 1.8.0b1 so I can't test it.
There's an assumption that ZF is already on your vhost's include_path somewhere. Zend_Application allows you to specify additional include_paths specific to your application. If ZF is *not* on your include_path, you'll need to add it prior to requiring Zend_Application. A good place to do so is your .htaccess or vhost configuration, but you may also specify it in your index.php. -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/