Re: Debugging classes

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

 



On Jan 22, 2008 6:15 PM, Jochem Maas <jochem@xxxxxxxxxxxxx> wrote:

> TG schreef:
> > 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.
>
> debug_print_backtrace() is your friend. that said get an editor that
> supports
> debugging and install the required debugging extension on the server
> (which
> will probably be your local machine) this will allow you to initiate a
> debug session
> that allows you to step through the code line by line.
>
> I use Zend (debugger & IDE) for this, there are other options but I'm lazy
> and I've
> never had the patience to setup PHPEclipse+Xdebug (or something similar)


actually, if youre going the eclispe route, xdebug is supported under pdt.
its pretty
easy to install, because they have an 'all-in-one' bundle that has all the
requirements.
as jochem said, youll have to install xdebug on the server, which really
isnt that bad
(depending on your distro ;)).  you can also use xdebug with protoeditor if
you like, its
pretty decent.  to be honest though, ive had marginal success with php
debuggers so
far.  i dont know if xdebug + pdt (or protoeditor) is really ready for prime
time, but its
definately close.
of course there are other debuggers out there, but xdebug is really cool.
it has several
other features as well that make me think its the one to go w/.


> >
> > 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.
>
>
> debugging is a bit of a black art.


indeed.  sometimes, depending on the application, debuggers can almost be
life savers.
like some of these monstrous proprietary apps i keep getting myself caught
up in..

-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