Jun 14 2012
Jun 14

There are many source code editors available to pick form when Developing with Drupal, ranging from lightweight offerings such as Sublime Text, Coda and Textmate to full-blown IDEs like NetBeans and Eclipse.

For quick edits, many prefer the speed and simplicity of Sublime Text, an up-and-coming favorite and I'm no different. However, I often miss the code completion, input hints, advanced debugging with XDebug and refactoring capabilities of a real IDE. That's where NetBeans comes in!

Despite being (rightfully so) labelled as a memory-hog, the newest NetBeans 7.2 beta release offers some great performance improvements and makes it a very attractive choice. My personal favorite feature (not by any means exclusive to NetBeans) are code templates, where you type a shortcut, press tab and boom, code snippets are inserted in the document.

I've put together a lengthly list of useful templates that can really help you speed up development times and reduce time spent looking up api.drupal.org in order to remember arguments and their orders for commonly used Drupal hooks. I've exported them and made them available as a project on Drupal.org so head on over and grab it while its hot!

I've also recorded a quick screencast to demonstrate this feature in case anyone wants to see it in action:

I hope you find this useful!

Dec 16 2011
Dec 16

I usually use linux, but for various reasons I've needed to use windows lately and so I figured I would setup Xdebug, Acquia Dev Desktop, and Netbeans in Windows.  I didn't see much for guides out there but its really pretty easy.

Step 1 - Install Acquia Dev Desktop:

You can install either the D6 or D7 one, because really they are the same and you can just add D6/7/yourflavor to it using its "import" button.

I installed this to "C:\acquia-drupal" and "C:\sites\acquia-drupal".  That way I don't have to worry about the spaces when configing my php.ini files.  Spaces in file directories always seem to cause me issues.  Like so:

Step 2 - Install Netbeans

I just went for the php version.  Once its installed you can download any plugins you want.

Step 3 - Setup Netbeans

This is pretty easy, I just basically followed: http://drupal.org/node/1019816.  Some of the options shown on that url are missing in my netbeans, so I just ignored them.

Also, install whatever plugins you want (git is a good one) from W.  To do this I had to run netbeans as administrator (in windows 7), everytime after that I didnt, but to get it going the first time I had too.

Step 4 - Add your project and config it for debug

The Drupal.org link above shows you how to add a project.  One tweak I would do after you add the project, right click your project > properties > Run configuration > Advanced > Do not open webbrowser.

Step 5 - Setup PHP for xdebug.

I noticed Acquia Dev Desktop had the xdebug extension already in the "C:\acquia-drupal\php5_2\ext" folder so I didn't even have to download it.

All I did was edit my php.ini file.  I added this to the bottom:

[debug]
zend_extension_ts=C:\acquia-drupal\php5_2\ext\php_xdebug-2.1.2-5.2-vc6.dll;
xdebug.remote_autostart=off
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

You can find a link to your php.ini file opening your Acquia Dev Desktop Control Panel and clicking on Settings, then config tab, then the "edit" button next to the php.ini file.

After you add the above to the php.ini file, stop and start the Acquia Drupal Stack.  Now, go back into setting, config tab, and click the phpinfo link.  This will open a page where you can see if xdebug is setup and working.  If you see anything about xdebug on that page, its probably working.

Step 6 - Install the easy Xdebug plugin for FireFox

This will put 2 little icons in your lower right of firefox, a bug-looking-thing and a green square.

Step 7 - Setup Breakpoints and debug

Boot up Netbeans, Acquia Drupal Stack, and Firefox. 

In firefox, go to the php page you want to debug. 

In netbeans, add breakpoints to where you want to stop.  Then click to the debug button in netbeans:

In firefox, click the green bug (lower right from easy Xdebug) and reload the page.

TADAAA, Netbeans will stop at the breakpoints and show you variables and such.  Very cool.

Conclusion

So there you go.  Pretty quick and easy to get up and running.  If you have any questions just let me know.  I'm not a pro at this stuff but I'll sure try and answer whatever you throw at me.

Feb 24 2009
Feb 24

Organizers of DrupalCon DC,  in the lead up to the event, asked Sun and the other event sponsors a few questions about their relationship with Drupal.  The first question was:

How does Sun work with Drupal?

I provided this answer:

There are too many ways in which Sun works with Drupal to list them all here, but some of the highlights are:

  • In 2005 Sun donated a server to drupal.org when scaling and performance problems were hampering growth
  • Then in 2007 Sun donated another server to further propel the scale up of d.o
  • Sun has used Drupal in building several important online communities:
    • Freshbrain - a technology exploration platform for youth
  • Plus many organizations run Drupal on Sun technology
  • Employees at Sun have been using Drupal internally for lots of things, including:
    • as representative AMP stack environment and workload for lots of benchmarking and performance testing
    • to demonstrate certain technologies, both in Sun internal training, and with Sun's customers, e.g., using the Webstack pre-built bundle of AMP and other open source packages for OpenSolaris, Virtualization with Solaris zones, MySQL installation and tuning, and PHP code analysis with DTrace.
  • Sun has created a NetBeans plugin wizard for developing Drupal modules
  • Sun is currently investigating system appliances for data archive and CMS that would bundle Drupal
  • Of course, Sun is a large contributor to some of Drupal's most critical underlying open source technologies:
  • and let's not forget that Sun VP and inventor of Java, James Gosling, defended Drupal inventor Dries Buytart in his PhD examination at Ghent.

Clearly, Sun is deeply connected to the Drupal community in many ways.

All the Q&A from DrupalCon's sponsors will be posted here on the DrupalConDC site.

\* Entry corrected to say Sun has contributed more FLOSS code than any other single institution, not Sun has contributed more code to the Linux kernel than any other single institution (although I think I did read that somewhere, it's not substantiated in this paper).  Thanks to Matt for point that out - it's major difference.

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