I agree.  It should be stopped in both cases.  That is the behavior I  
would expect.  If any filters or whatnot needs to be run, it should  
be the responsibility of the developer to make sure they execute  
before the redirect.

Charley

On Oct 12, 2007, at 3:00 AM, Fabien POTENCIER wrote:

>
> Hi Lukas,
>
> We have 2 redirect() methods in the framework, one in sfAction and the
> other in sfWebController.
>
> The one in sfAction is defined like this:
>
>    public function redirect($url, $statusCode = 302)
>    {
>      $this->getController()->redirect($url, 0, $statusCode);
>
>      throw new sfStopException();
>    }
>
> So, if you call the redirect from an action, the execution is stopped
> (thanks to the ugly sfStopExecution exception ;-)), but if you call  
> the
> redirect from the controller, the execution is not stopped.
>
> This is really weird.
>
> If everybody agrees, I can commit a patch to stop execution in both
> cases which seems to be the right thing to do.
>
> Fabien
>
> --
> Fabien Potencier
> Sensio CEO - symfony lead developer
> http://www.sensiolabs.com/
> http://www.symfony-project.com/
> Sensio Labs
> Tél: +33 1 40 99 80 80
>
>
> Lukas Kahwe Smith wrote:
>> Hi,
>>
>> It seems like redirect does not end the execution prematurely as I
>> would expect. Is this a bug or a feature? I guess one could say that
>> filters and other stuff may need to get the opportunity to finish up
>> even when you call redirect. But I do not remember ever having a case
>> where that was necessary.
>>
>> I noticed this issue in regards to sfSslRequirementPlugin, that is
>> just calling redirect(), but that still ends up executing the entire
>> request.
>>
>> regards,
>> Lukas
>>
>>>
>>
>>
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to