Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

One set of developer tools for Drupal

Parent Feed: 

There are many useful editors and debuggers useable to churn out Drupal code. However, most popular IDEs are written in some non-native language, so they are so very resource intensive and because of that, so slow that I just can't use them. This includes Eclipse, Zend and Komodo. So, this article will not be about these. Neither I will write about the virtues of vi or emacs -- I use much simpler tools.

To begin with, I run Kubuntu Linux. Why that? Mac OS X does not recognize the WiFi in my laptop (and it's not the kind of laptop where you can just switch miniPCI cards). Next up would be maybe Windows, but I want to work instead of wrestling with an operating system that never does exactly what I wanted -- it sometimes does less, sometimes more and sometimes simply does not let me do certain things. I happen to have quite some experience with Linux on servers, so running Linux on the desktop is not that hard either. Which Linux, though? I very much like the APT package manager and out of the distros built around it, I like Ubuntu most (and I am not alone...). The choice between KDE and Gnome was easy, Linus Torvalds famous letter puts this into words better than I could. So we arrived to Kubuntu Linux. In general, the OS behaves rather well with my laptop (aside from a small issue with brightness), and all the issues that were a nightmare for years (WPA for wifi...) got really smooth and simple this year. So Kubuntu Linux is now a pleasure to use. Aside from the operating system, I only deal with source code, so I need something with which I can edit, view, control and search.

I almost always work remote, so easily accessing files remotely are very important to me. It so happens that KDE has an excellent "io slave" subsystem. It means I can open a dir like fish://user@example/home/user/ and it'll SSH in to user@example and show the dir as if it would be local. There is a webdav kioslave, too. I am using the native KDE editor, KATE. KATE has a nice syntax highlight and a rather primitive, string based autocomplete, but that's often enough -- curiously, given how Drupal uses many indirect ways to call a function, a string based autocomplete is often better than one based on actual PHP syntax. It also has a script debugger (see my blog post) which I do not use that much, my debugging needs are nicely covered with the occassional print, var_export etc. statement. Quite primitive, I know, but it works always -- by not getting accustomed to a debugger I can easily work in a terminal window over SSH with whatever editor I have access on whatever website I need to work on at the moment (I prefer nano in a terminal). Primitve tools have their own uses :)

My browser of choice is Opera, it's just faster and does not eat up resources. I might change to Firefox 3, the jury is still out there -- they claim to fix the memory leaks, we shall see. However, I already use FF as an HTTP debugger with Firebug and the Web Development Toolbar plugins.

I use bzr as the source control system for core. Again, I do not use much of its features, but as there is a big company (Canonical) behind it, the mirror (https://launchpad.net/drupal/main/) not just works rather well but I can expect it to be up for a long time -- it's now up for more than a year now. It's very easy to copy the mirror to the local machine -- and now it's very fast too, in the past it was like ten minutes, now it's about one minute to get the 8000-something revisions. The same bzr branch command lets me create as many branches as I want. I keep around a handy and simple alias (B='bzr diff --diff-options -up') which rolls my patches. If I just want to work on something quick, I do not create a separate branch, rather revert, change, roll the patch and then repeat. I only use branches when I have some patch which takes a lot of time. (This is why you sometimes see accidentally merged patches from me.)

Next up is search. The basic Unix tools are find, grep (and occassionally, cut). Another very useful tool is cscope. I keep a cscope.files in the Drupal directory listing all the .module, .inc, .php, .engine, .theme files and then cscope can quickly show me where a function is defined and where it is used.

In the miscellaneous section, the first mention goes the trusty companion of the well known SSH utility: ssh-agent, which can store you private key in memory, totally avoding typing in any passwords. Even less known is ssh-copy-id which copies your pubkey to a server in one quick step.

Another important utility is kcachegrind which tells me about slow parts of some by visualizing the output of the xdebug profiler.

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web