I haven't yet had the time to look into it in much detail so I'm
afraid I'm not much help. I think you are absolutely right though. I
also think it's odd that the $recursion variable that keeps getting
counted down whenever exportVar() is called (except when it is called
from __object()) and is never used.  $recursion seems to be
deincremented and that's it, it is never used for anything else.
Perhaps it was meant to break when $recursion reached some value but
the code was never implemented? I'll have to compare to 1.1's code and
see if I can make sense of what they are trying to do.

Dave


On Jan 23, 3:22 pm, jonknee <[EMAIL PROTECTED]> wrote:
> Great, thanks for the tip. This is almost certainly a bug since the
> debugger should never get stuck in an infinite loop. If I take the
> __object() call out of the 'object' case, everything works fine (even
> with get_class() intact). I just wonder what the intended behavior is,
> the documentation isn't there.
>
> I did some digging and here's what I found:
>
> __object() is getting called infinitely from that object case, I added
> a counter and it counts as long as I let it. So here's what I think is
> going on, Debugger::exportVar() is called and when it gets to the
> object case it calls Debugger::__object(). Debugger::__object()
> executes and in turn calls Debugger::exportVar(). Which calls
> Debugger::__object(), rinse and repeat.
>
> I'm not sure what the intended data is, so I can't write up a patch.
> Any ideas?
>
> On Jan 23, 4:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > actually, after re-reading my post I think you're seeing problems with
> > the same function that I am (the __object($var) function, not the
> > get_class() function as I stated above) try commenting out the same
> > lines of code from my earlier post:
>
> >                       //causes some sort of overflow
> >                         //case 'object':
> >                         //      return get_class($var) . "\n" . $_this-
>
> > >__object($var);
>
> > on line 364. It's the only place in the debugger that __object($var)
> > is called so I bet it will fix it.
>
> > Dave
>
> > On Jan 23, 2:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > here is my previous 
> > > post:http://groups.google.com/group/cake-php/browse_thread/thread/48c6a57a...
>
> > > On Jan 23, 2:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > I was having a similar problem with the cake debugger running out of
> > > > memory on an error (in this case it was an undefined variable in the
> > > > view). I just commented out the offending lines of code in /cake/libs/
> > > > debugger.php. The problem was a call to the get_class() function and
> > > > it looks like it's happening with you on line 414 as well. I'd try
> > > > commenting out the following:
>
> > > > //if(in_array($serialized, $history, true)) {
> > > > //       $value = ife(is_object($value), "*RECURSION* -> " .
> > > > get_class($value), "*RECURSION*");
> > > > //}
>
> > > > and see if it starts behaving.
>
> > > > Dave
>
> > > > On Jan 23, 1:54 pm, jonknee <[EMAIL PROTECTED]> wrote:
>
> > > > > I recently upgraded to v1.2 and have been playing around to get Smarty
> > > > > working (which is how I was using Cake 1.1). It's going fine except
> > > > > when I call a variable that doesn't exist... Smarty throws the
> > > > > 'Undefined index' error that should be no problem (and in most cases
> > > > > not be seen), but Cake's debugger takes over and gets stuck in a loop.
> > > > > The httpd process takes 100% of the CPU and 30 seconds later I see a
> > > > > message that the script was halted because the maximum execution time
> > > > > was exceeded.
>
> > > > > > [error] PHP Fatal error:  Maximum execution time of 30 seconds 
> > > > > > exceeded in /Library/WebServer/cake/cake/libs/debugger.php on line 
> > > > > > 414
>
> > > > > Any ideas on how I could either see what the code is choking on or how
> > > > > to let Smarty opt-out of the Cake error sequence?
>
> > > > > The compiled Smarty code that's causing this comes out looking like:
>
> > > > > <?php echo $this->_tpl_vars['variable_name']; ?>
>
> > > > > If $this->_tpl_vars['variable_name'] isn't defined the whole thing
> > > > > goes into the endless loop and I have to kill the process or wait it
> > > > > out.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to