Search code examples
drupalxdebugeclipse-pdt

PDT, XDebug & Drupal


I'm using Drupal, XDebug & PDT.

I need to know if I need to build, index, and lots of stuff just to debug a simple file?

Lets' say for example that I'm working on a Drupal module, with 3 files. Do I need to compile, build, index all Drupal... just to be able to insert a breakpoint in one file?

Also, if you could explain why yes or why not, will be better.

Thanks! :)


Solution

  • In short yes. Drupal is bootstrapped for every page request that is made to your webserver. It is within that drupal flavored environment that your script runs, which is why it has access to the Drupal DB, Form Api, Fields Api, module hooks, etc.

    If you just want to test the logic of your script and it doesnt rely on drupal elements like the mentioned above you can certainly debug it as a simple script in eclipse instead. That said there shouldnt be a ton of overhead debugging drupal itself in the first place.

    Good luck on your debugging adventure. Once you get it up and running it makes you MUCH more productive and i promise its worth it.