Matthew Weier O'Phinney-3 wrote:
> 
> -- 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/
> 
> 

Is this approach to negate the need to discover the framework for
application entry points other than index.php? That is scripts and the like.
It was the following line in the quickstart that partly led to my first
post:

includePaths.library = APPLICATION_PATH "/../library"

Is it not recommended/best practice to put the framework in this directory?
Therefore it would already be on the include path when bootstrapping? If the
line is simply to illustrate adding include paths in the config file or
because the manual hasn't yet been updated then that's cool.

Cheers

Steve

P.S. Pats on the back to yourself and Ben Scholzen on this component,
Matthew - 1.8 stable is sure to be an excellent update!
-- 
View this message in context: 
http://www.nabble.com/Zend_Application-Bootstrapping-tp23145548p23204447.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to