-- Robert Castley <[EMAIL PROTECTED]> wrote
(on Wednesday, 03 September 2008, 11:32 AM +0100):
> In the tutorial it sets:
>  
> $bootstrap = true;
>  
> in index.php
>  
> then in bootstrap.php it does a:
>  
> if (isset($bootstrap) && $bootstrap) {
> ...etc.
>  
> Why is this done?  To me it seems unnecessary or am I missing the plot?

The flag is for testing. Zend_Test_PHPUnit can make use of the
bootstrap.php file to setup the application environment used in testing.
However, there is often code that you want to execute on your web server
that you don't want to execute in your tests, but which is still
application specific -- setting up autoloading, setting up your config
objects (you should typically use different config sections in testing
than in development or production), etc. 

Having the $bootstrap flag helps to ensure that you can keep all
application setup for the web application in one place, while allowing a
slightly different setup for tests.

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to