2008年9月22日星期一

Re: [fw-mvc] why setting the $bootstrap variable to TRUE in index.php?

Yep, you missed something. You missed the part where we updated the
quickstart without you looking... ;)

In all seriousness, we have updated the quickstart application Monday of
last week. In the new version we have moved all PHP Environment specific
stuff inside the index.php. This then reduces the need to have the
$bootstrap flag (which was originally there to facilitate iterative testing
with Zend_Test inside MVC applications).

Have a look at the new one, and the docs in the new quickstart and see if it
makes more sense now.

-Ralph


On 9/12/08 11:01 AM, "Guillaume ORIOL" <goriol@technema.fr> wrote:

> Hi,
>
> The new quick start for ZF 1.6 explains how to create a public index.php
> file that will be the only entry point of the application.
> This file starts with:
>
> |<?php
> // Step 1: Set a flag indicating setup is necessary
> $bootstrap = true;
> ...
>
> Then, the boostrap.php is described and an example is given that starts
> with:
>
> ||<?php
> // Step 1: Check to see if the applicaiton environment is already setup
> if (isset($bootstrap) && $bootstrap) {
> |...
>
> My question is:
> why setting a $bootstrap variable and testing it in the bootstrap file?
> As the index.php will be run at every request, the $bootstrap variable
> will always be true and the "if" section will always be executed.
>
> Did I miss something?

--
Ralph Schindler
Software Engineer | ralph.schindler@zend.com
Zend Framework | http://framework.zend.com/

没有评论: