2008年9月12日星期五

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

Could you give me a use case where $bootstrap should be set to FALSE?


jkush1121 wrote:
>
> Don't take my word for final, as this is clearly something which Matthew
> should respond, but my understanding is that it serves as a preventative
> measue to ensure that the bootstrap will setup once. Upon turning to
> false, the setup will bypass. I see what you are saying though, being that
> it only hits the page one time. It might just be more preventative
> measures.
>
>
> goriol wrote:
>>
>> Hi,
>>
>> The new quickstart 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?
>>
>>
>
>

--
View this message in context: http://www.nabble.com/why-setting-the-%24bootstrap-variable-to-TRUE-in-index.php--tp19458419p19461033.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: