Hi,

Normally, an application should not have infinite dispatch loops. They
should be eliminated during development stage just like other bugs.
So the developer need to know what cause these loops and change the
application and this property is definitely not what can help much in
that case. I think this should be solved by adding an optional
controller plugin. It may log all forwards and throw en exception if
there are to many of them.

Sincerely,
Alex

On Nov 30, 2007 5:23 PM, Julien Pauli <[EMAIL PROTECTED]> wrote:
> Hi everybody.
>
> I'm wondering why there is not actually any FrontController system to
> prevent infinite dispatching loops.
> Some of you massivelly use _forward or other tricks like that, but a loop
> limitation should be set into FC as we all know that it is easy to get an
> infinite dispatch() loop (specially while manipulating multiple plugins or
> action helpers ).
>
> Why not set a private static property in FC called (for example)
> maxDispatchLoopBeforeExit ?
> This, with accessors (getter setter) and a default value to figure out (I
> think 10 should be a reasonable average).
>
> In the dispatch loop, FC just increments an internal variable, and at the
> end of the loop, checks its value with its static 'flag'.
>
> If over : it should then break the dispatch loop throwing (or response
> appending) an exception ( ' infinite dispatch loop presumed' , something
> like that ).
>
> Is that a good idea ?
> Maybe someone has already thought about that ?
>
> cheers.
>
> Julien.Pauli
> http://www.z-f.fr
>



-- 
http://www.alexatnet.com/ - consulting, blog, articles and support for
PHP, ZF, JavaScript and web development.

Reply via email to