Slides from DrupalCamp Iowa 2011

Here are the slides from my morning presentation at yesterday's "DrupalCorn" DrupalCamp in Des Moines, Iowa. The presentation was designed to be a brief high-level overview of Drupal.

Introduction to Drupal 7 Architecture (PDF, 1.8MB)

[ Submitted by John on Sun, 2011-09-18 20:46. | | ]

Pro Drupal Development, Third Edition arrives

The author's copies of Pro Drupal 7 Development, Third Edition arrived today.

Although this book is thinner physically than the second edition, the pages are actually wider and there are more of them: 689 pages all told vs. 667 in the second edition. That's the third edition on the bottom in the picture below.

Here's the traditional picture of me and the little guy. Time flies!

[ Submitted by John on Thu, 2011-01-13 16:04. | | ]

Drupal In BSD Magazine

Drupal is featured in the October 2010 issue of BSD Magazine (email address required to download).

[ Submitted by John on Wed, 2010-10-13 21:36. | | ]

Solr Multicore with Drupal Apachesolr Module

Sometimes a picture is worth a thousand words. Here's Apache Solr in a multicore setup with two cores, one named hhpn and one named picdinfo. I thought this setup was nice because it allows one site to use the schema from the apachesolr 6.x-1.2 release and one site to use the schema from the 6.x-2.x-dev branch.

References:

http://drupal.org/node/484800
http://janaksingh.com/blog/apachesolr-search-drupal-centos-107

[ Submitted by John on Wed, 2010-10-13 16:03. | | ]

Changing Drupal database URLs programmatically from the command line

I had a need today to batch-change a lot of database connection strings in Drupal installations. You might need to do this if you have a lot of sites and are switching from webserver-and-database-server-on-the-same-box to Drupal with a separate database server. Here were some handy shell commands that I used.

Find all the settings.php files in this directory tree:

find /var/www/html -name settings.php -print

Show all the current database connection strings (make sure no one's looking over your shoulder!):

find . -name settings.php -exec grep -nH ^\$db_url {} \;

The grep finds lines beginning with $db_url. The -n switch prints out the line number of the match; the -H switch prints the filepath. Sample output:

./foo/site1/sites/default/settings.php:93:$db_url = 'mysql://myuser:secret@localhost/database1';
./foo/site2/sites/default/settings.php:93:$db_url = 'mysql://myotheruser:othersecret@localhost/database2';
...

Now, change the sites from pointing to localhost to pointing to database.example.com:

find /var/www/html -name settings.php -exec sed -i '80,95s#t@localhost#t@database.example.com#' {} \;

Translation to English: descend recursively into the /var/www/html directory. When you find a file named settings.php, look in lines 80-95 of the file. If you find a string that contains t@localhost, change it to t@database.example.com. Save the file, overwriting the file that is currently there (that's the -i switch to sed). The # characters are delimiters.

Note that I'm cheating here, because I happen to know that all passwords end with the letter t which makes my string matching easier.

[ Submitted by John on Mon, 2010-06-07 15:27. | | ]

Slides from Batch vs. Queue: an API Smackdown

Here are the slides and the two testing modules from my presentation at DrupalCon San Francisco 2010. The modules run on Drupal 7.

Slides from Batch vs Queue: an API Smackdown (5.8 MB PDF)

[ Submitted by John on Tue, 2010-04-20 13:39. | | ]

Performance presentation, Des Moines Web Geeks

Matt Nuzum, the webmaster of ubuntu.com, invited me to speak at the Des Moines Web Geeks meeting last night. The venue, Impromptu Studios, was a bit hard to find. There were no signs for Impromptu Studios, but after lurking in dark alleyways for a while I eventually discovered what should have been obvious from the beginning: enter the furniture store with the "Closed" sign on the front and go up the stairs past the disused lavatory with a sign on the door saying "Beware of the Leopard."

The group was great and we talked for about an hour and half about bottlenecks and optimization. I even went home with a Django book!

Since this was a diverse group I tried to talk about things that everyone has to deal with (bottlenecks for storage, network, memory and CPU) rather than anything Drupal-specific.

As promised, last night's slides: Performance, Scalability on the Server Side (PDF, 1MB).

[ Submitted by John on Tue, 2009-09-22 09:07. | | ]

Drupal on Cover of Information Week

Look what's on the cover of the November 17, 2008 issue of Information Week! Drupal is mentioned several times throughout their series on open source.

[ Submitted by John on Thu, 2008-11-20 15:01. | | ]

What Pro Drupal Development is, and What it Is Not

As copies of Pro Drupal Development, Second Edition hit the streets, I'd like to take a moment to clarify what the book is and what it is not.

What it is not

  • A complete and comprehensive guide to using MySQL with Drupal
  • A detailed howto on integrating Drupal with Sphinx
  • The ultimate reference on using jQuery/AJAX/JavaScript with Drupal
  • A step-by-step tutorial on building an ecommerce site with Drupal
  • ...

What it is

The target audience of Pro Drupal Development is smart people who know PHP (or other languages; PHP can be picked up pretty easily) and are looking for an overview of how Drupal core works. It achieves this by walking through Drupal's major systems: users, nodes, filters, triggers, themes, etc. One of the challenges in writing the book was knowing when to stop. Take theming, for example. To do justice to Drupal's theming system would take a 400-page book in itself. The same goes for working with multimedia files, or optimization, or jQuery. The idea of Pro Drupal Development is to lay down the basics in each of these areas so that the reader is oriented and can then go on to use other resources, or to just better understand the code itself. Other books are being written that will provide great detail in specific areas, and I'm glad to see that -- it's a sign that Drupal is maturing and becoming well-known enough that there is a demand.

Pro Drupal Development was written to provide an on-ramp for intelligent people starting with Drupal so they can avoid months of feeling dumb in irc or having to piece together the big picture from a blog post here, a doc page there, a README here (that's the way I learned Drupal, and it's a frustrating way to learn). If the book fulfills this goal (and from my conversations with new developers it has) then I am satisfied.

When you find errors in the book, please post them as errata so that others can benefit. I'd recommend that when you get the book, go through the errata and make notes in the margins so that when you use the book for reference, you'll see the corrections. With the first edition, we were able to correct a lot of the errors in the second and third printings.

[ Submitted by John on Thu, 2008-08-21 14:21. | | ]

Pro Drupal Development, Second Edition arrives

The author's copies of Pro Drupal Development, Second Edition arrived today. At 667 pages, the book is significantly thicker than the first edition!

I worked on this edition from November of 2007 to July 2008 pretty much without stopping. One morning my daughter found me in the living room writing a chapter at 3 am. It is difficult to express how much work this book has been, and how happy I am to hold the printed copy in my hands. Those who have written books will understand. :) I am glad to finally have it get into the hands of Drupal developers everywhere, and I hope that this contribution helps to complete the transition from Drupal 5 to Drupal 6. Thanks so much to all who have helped with this project!

Profits from the book go to this little guy's college fund. (And if you buy it through drupalbook.com, the Drupal Association gets a percentage of each sale.)

[ Submitted by John on Mon, 2008-08-18 12:26. | | ]