I have found PHP nirvana in a box.
I was trying to debug the lastest dev version of the userpoints module for Drupal, and was getting nowhere. The process of debugging PHP is tedious to begin with, but the practice of putting print statements into your code in places you think are likely the problem is a nightmare, and a huge black hole for productivity. Understanding what hooks are getting called and when they execute via print statements is a good way to waste an entire afternoon.
Enter Zend Studio. Their newest version is based on Eclipse, the open-source IDE that ties development in many languages into a single common UI. Zend Studio supports interactive debugging sessions with the server version of its debugger, and the client-server communication allows you to step into, over, and return from bits of code. It tells you what variables are currently in the stack, what the chain of functions is that is being called, and many other useful things.
I have to admit, I didn’t come to this point of nirvana without trial. In trying to configure the Eclipse PDT to communicate effectively with the server debugger running on a remote server, I failed spectacularly. I tried a few other IDEs, and found them all to be unacceptable. I even tried Zend Studio 5.5. I was at the end of my patience when I found the newest version of Zend Studio, which. just. worked. Yes, I said it. It just worked, with the exception of changing the default port setting for the remote debugger.
My frustration is gone, I am at one with the code, and I can finally explain exactly what is going on in Drupal - how things get called, where and when they get called, and what the results of each call are.
And that bug with the userpoints module? The problem existed between keyboard and chair.
tags: drupal, eclipse, ide, php, zend, client, code, debugger, module, server, userpoints
I have the distinct pleasure of attending DrupalCon 2008, which is being held in Boston, MA this year. This year’s attendance has blown out the attendance levels of previous DrupalCons, and it is a testament to the growing popularity of Drupal as a content management system.
