Wednesday, November 19, 2014

Joomla Debugging.

I've gotten by without needing a real debugger for Joomla extension development, up until now, when I'm upgrading some extensions from V2,x to V3 conventions.  I've got a background in serious debugging (assembly, real time and networking, C++) but just never really needed more than I could get by with using JDump and other means of logging and debugging.

So, two days ago, I took what seemed to be the natural jump, installing Eclipse and LAMP with XDebug on a spare UBuntu machine.  After a day and a half , I managed to get a limping project to semi-reliably breakpoint in index.php, but then couldn't figure out what to do next.  And oh, why does Eclipse have to be quite so heavy in getting a working configuration without hiring an expert to set it up?

Dismayed about facing another day or so to get to the problem I'm currently trying to debug, I decided to give Netbeans a quick look.  I made one small false start, using UBuntu apt-get install netbeans, which installs V7 of the IDE which only supports up to V5.3 PHP (as of November 2014).  But that was just a 20 minute mistake, easily resolved by uninstalling and then using the Netbeans direct package download of the PHP-HTML version of the Netbeans package 8.x.  Ten minutes later, PHP plugin installed and a package created out of the joomla install directory.  Another 5 minutes to get into the debugger in index.php (had to figure out how to configure the port, added 3 minutes).  And lo, I could step out into other files, without figuring out anything else like setting up an ant build to create the information required for cross file debugging.  Another 5 minutes to learn how to get into my component's back end.

I don't know if in the long run I could do more with Eclipse, but given that I'm pretty attached to Dreamweaver and usually don't need serious debugging,  I give Netbeans / PHP / XDebug a gold star for the day, and assume tomorrow, I'll be able to figure out the problem that I couldn't resolve without a debugger, with little or no further futzing around to figure out how to get to HELLO, WORLD, WTF?  Good night!

Charlie