Re: Debugging classes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 22, 2008 1:06 PM, TG <tg-php@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>
> I have a semi-good understanding of classes even if I don't totally 'grok'
> the benefits for the projects I've worked on so far.
>
> One thing that keeps smacking me in the face, though, is reverse
> engineering
> in order to make proper changes to projects created by others using
> classes.
>
> In particular, I've been doing a lot of Joomla work and I end up doing a
> global "find in files" trying to trace things back to see where they're
> assigned, etc.
>
> In particular 2, "$this".  I know it's a keyword meaing "the active
> object"..
> I'm cool with that, but sometimes I need to make changes to how things are
> handled, or what data is included.  I can do a print_r and see what type
> of
> object it is, look up the class definition, etc, but it still seems like a
> pretty cumbersome way of doing things.
>
> Anyone have any tips for debugging/reverse engineering/noodling-out
> classes
> on big projects created by someone else?
>
> I figure things out eventually, I just want to speed up the process and do
> it
> 'smarter' if possible <http://www.php.net/unsub.php>


unfortunately the runtime relationships of objects can be quite different
than
relationships between the classes they incarnate.
sometimes debugging tools like xdebug can help you see relationships at
runtime
by mapping out the call stack graphically (checkout kcachegrind).
in general though, you need to have an understanding of what the classes in
an
application are supposed to do / represent.
for joomla, have you scoped out the api spec?
http://api.joomla.org/li_Joomla-Framework.html

i imagine that would help you work through it.

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux