Book Review: Drush User's Guide 36
Michael Ross writes "With the advent of graphical user interfaces (GUIs) decades ago, most of the commercially-available software transitioned from command-line usage to point-and-click interfaces, with the majority of these applications completely phasing out all command-line capabilities, or never implementing them in the first place. But for programmers — most of whom are comfortable working on the command line — performing administrative actions within a GUI can become tedious and time-consuming, and there is a growing movement toward adding command-line support back to software development applications. An example of this is Drush, which is a command-line interface for the Drupal content management system. Drush, whose name is derived from "Drupal shell," was originally developed six years ago, and is seeing a resurgence within the Drupal community. However, what appears to be the primary information resource for Drush, the community documentation, currently has a status of "incomplete." Fortunately, there is now a book available that provides more extensive coverage, Drush User's Guide, authored by Requena Juan Pablo Novillo ("juampy"). The book was released by Packt Publishing on 10 April 2012, under the ISBN 978-1849517980. The publisher's page offers descriptions of the book, its table of contents, a brief author biography, the known errata, the example code used in the book, and a free sample chapter (the third one, "Customizing Drush"). This review is based upon a print copy kindly furnished by the publisher; an e-book version is also available." Read below for the rest of Michael's review.
The book comprises 125 pages, mostly grouped into four chapters, which cover how to install, use, customize, and extend Drush. The preface briefly summarizes those chapters, the software needed to use Drush, the target audience of the book, the styling conventions used in the text, and various publisher information. The author states that "Apache 2.0 or higher" is required to use Drush (page 2), but the project's README.txt does not mention this, and Drupal 7 itself runs fine on Apache 1.3; so this requirement is unclear. He also states that "Drush 4 does not support Windows" (page 13); Windows users are instructed to use Drush 5. This seems questionable, since a quick test revealed that Drush 4.5 runs on a Windows XP machine. Admittedly, it always elicits a warning: "Drush 4.x has significant limitations on Windows; it is not advisable to use on that platform. Substantial progress has been made towards supporing [sic] Windows on the 5.x branch; please upgrade."
Drush User's Guide | |
author | Requena Juan Pablo Novillo |
pages | 125 pages |
publisher | Packt Publishing |
rating | 8/10 |
reviewer | Michael J. Ross |
ISBN | 978-1849517980 |
summary | A tutorial on Drupal's CLI. |
The first chapter of the Drush User's Guide naturally begins with instructions on how to install Drush on Linux, Mac, and Windows systems. The book's examples use Drush 4.5, even though 5.1 was available at the time of the book's publication, and 5.0 was available a month earlier. Version 4.5 was the last 4.x release, and was probably the latest stable release when the book was being finalized. Throughout the book, all Windows instructions are specific to Windows 7, so any XP straggler will need to modify them as needed. In the "Manual installation" section, the subheads are almost identical in font size to the higher-level subheads, forcing the reader to check the table of contents hierarchy just to see where the manual installation instructions end. But the main problem is that the reader is not given recommendations as to which optional features should or should not be chosen. For instance, if you already have PHP installed on your system, should you decline to have the Drush installer try to add the "Php [sic] Required Runtime," even though it is enabled by default?
The author then shows how to set up a Drush-specific PHP configuration file, in order to bypass potential problems, such as memory limitations in the default configuration file. In the rest of the chapter, he demonstrates how to perform Drush commands (in general), define arguments and options for those commands, create command aliases, and specify which Drupal website any Drush command is supposed to operate upon.
In the second chapter, "Executing Drush Commands," the author shows the reader how to perform a fresh installation of Drupal 7 — including creation of the database and its tables — with just two commands. He introduces the music festival website that will be used throughout the rest of the book for demonstration purposes. At this point, some readers may hit a stumbling block: The "--drupal-project-rename" option used in the text fails on Windows machines (this is a known issue). Presumably the author did not test his suggested commands in a Windows environment. The bulk of the chapter is devoted to introducing numerous Drush commands, including those used to get and set variables, install modules, administer users, back up the database, and many more.
The author notes that "Drush is highly configurable," and in the third chapter he shows the reader how to create custom commands, include their help information in the output of the command "drush help," extend existing commands, run custom PHP scripts, and define site aliases. Readers new to Drupal may find these topics fairly advanced, as they necessitate familiarity with command namespaces, as well as Drupal's hook system, callbacks, and database API. Defining remote site aliases involves SSH and public keys. However, given the flexibility and power of custom Drush functionality, it is arguably worthwhile to make the effort to learn how to do it properly. At the end of the chapter, the reader learns how to use and configure the Drush command-line interface.
The fourth and final chapter, "Extending Drush," discusses how to utilize some of the modules that are integrated with Drush — specifically, Backup and Migrate, Devel, Features, Views, and Module Builder. The chapter concludes with a section on Drush Make, which packages the module information of a Drupal website so it can be re-created using Drush easily.
As with all of the Packt Publishing titles that I have reviewed, this one has a high number of errata relative to the total page count, aside from the seven already reported online (as of this writing): "command line interface" (page 1; "command line" should be hyphenated when used as an adjective), "book title through the subject" (same page; should be "book title in the subject"), "Clear cache" (page 7; should be "Clear all caches"), "follow [the] instructions" (page 13), "close [it] and open [it] again" (page 18), "try and" (page 21; should be "try to"), "change version by something" ("by" should be "to"), "parenthesis" (page 23, twice; should be "parentheses"), "within [the] sites subdirectory" (page 25), "execute commands towards" (page 26; "towards" should be "on"), "MySql's" (page 28; should be "MySQL database's"), "provided with it" (should be "provided it with"), "that resolves" (page 29; should be "resolves"), "First, of all" (page 33), "anoying" (page 48), "Imagine, that" (page 52), "lists [the] latest messages" (page 55), and "altering existing" (page 57; should be "alter existing"). At this point, not yet halfway through the book, I stopped recording errata. The Packt Publishing copyeditors should have spotted and fixed these obvious errors.
Although the author's meaning is invariably clear enough, the writing style is awkward in many places. For instance, "replace by" (page 4) should instead be "replace with," "take the chance to review" (page 41) should be "take the opportunity to review," and "of the flow" (page 55) should be "in the flow." The term "at" is used to indicate "in" a file — e.g., "at the Drush README.txt" (page 9); the same is true for MySQL tables — e.g., "stored at the variable table" (page 30). In addition, countless passages in the text would have benefited from a comma. Conversely, there are some extraneous commas (e.g., on page 43).
Yet the main flaw of the book is the neglect for readers who are using the Windows operating system for building and administering Drupal websites. The aforesaid "--drupal-project-rename" bug likely would have been caught had the Drush pm-download command been tested on a Windows computer. Another example is on page 48, where it is assumed that the command "firefox" will work as a link to the browser's executable on the reader's computer. Also, the ".drush" folder is critical for creating site aliases and other configuration settings; but where will the Windows user find this folder? This Linux partiality could result in Windows readers encountering — and possibly being frustrated by — confusing technical problems.
Nonetheless, the author does a fine job of explaining how to utilize the many Drush commands presented, as well as many of their arguments and options — oftentimes pointing out differences in their usage for Drupal 6 versus Drupal 7. Any Drupal developer interested in learning how to harness the power of a command-line interface for building and administering websites, should find Drush User's Guide a worthwhile tutorial.
Michael J. Ross is a freelance web developer and writer.
You can purchase Drush User's Guide from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
why not (Score:2)
Re: (Score:1)
Really? (Score:2)
Re: (Score:2)
This is relevant to my interests. I don't work with Drupal, but it does occasionally happen that a man page is not explicit enough. This would probably be a resource-of-last-resort after the man pages, docs, and google, but more information isn't usually harmful.
I do agree with you about the book reviews though -- I'll write one if you will.
Re: (Score:2)
This is relevant to my interests. I don't work with Drupal
If you don't work with Drupal then how is this relevant to your interests?
Re: (Score:1)
Drush Deploy (Score:3)
drush-deploy TARGET=qa TAG=qa_test_012
which would checkout to the qa environment and then run any additional commands (drush fr, drush cc all, drush rsync, etc) that I configure in my capfile. Very easy to use, built on top of Capistrano, automatic backups of environments, etc.
Re: (Score:2)
Re: (Score:2)
Maybe, but what if you could buy them with bitcoins!! that would be nice!
Real drush fun... (Score:2)
is piping drush into awk to create drush commands you can pipe to sh:
drush pml --no-core --status=enabled --pipe|grep content_type_|awk '{print "drush fu " $1}'|sh
Bring back Packt! (Score:2)
MichaelJRoss as reviewer: Check.
Book published by Packt: Check.
Book is about Drupal: Check.
8/10 or higher score despite pointing out major flaws in the book: Check.
Receive check for Packt: Cha-ching!!!'
Packt... the only publisher in the world (Score:2)
Shells scripts are inherently better .. (Score:2)
> A well written GUI can do just as much, just as easily, as a shell can ..
With shell scripts, you can automate the task, go for your walk, and when you get back, the task is done ...
Re: (Score:1)
And a well-written UI allows you to do batch processing and automation.
Re: (Score:2)
It is far easier to add new functionality to a CLI interface than to add it to a GUI, since you do not need to add the fluff around it (like distinct icon, interactions etc.)
Try SharePoint sometime: You quickly run into the situation where "sorry, you cannot do that in any of the web interfaces, you need to run a PowerShell command". Like "Add-SPSolution -LiteralPath D:\temp\SomeFarmSolution.wsp -Force"
Druish... (Score:4, Funny)
Funny. She doesn't look Druish.
Huh? (Score:3, Insightful)
How can a book that has a ton of errata, poor writing and buggy examples possibly be given an 8 out of 10? What's the point of a 10 point scale when what sounds like a poorly written book gets 8 points? You might as well just make the scale just 8, 9 and 10 at that point.
Re: (Score:2)
Money, money, money
Must be funny
In the rich man's world
Money, money, money
Always sunny
In the rich man's world
Aha-ahaaa
Re: (Score:1)
Re: (Score:3)
You might as well just make the scale just 8, 9 and 10 at that point.
For the record, my book [slashdot.org] received the lowest book rating he's ever given on /., which was a 6. Glad I could help set the bar somewhere.
Re: (Score:2)
You might as well just make the scale just 8, 9 and 10 at that point.
For the record, my book [slashdot.org] received the lowest book rating he's ever given on /., which was a 6. Glad I could help set the bar somewhere.
I just read that - was there anything unfair or inaccurate about the review?
He was encouraging in the final paragraph, I'd hold on to that. Also, kudos for donations to Drupal Association!
Re: (Score:1)
Make sure your next book is published by Packt. Then you'll be guaranteed at least an 8/10 review from Michael Ross.
Re: (Score:1)
Re: (Score:1)
Beware: this is spam for some payware product.
Check (Score:4, Funny)
Book from Packt Publishing? Check.
Book irrelevant to most slashdotter's needs or interests? Check.
Rating of 8/10? Check.
Review content consists of synopsis with no real criticism? Check. (Seriously? It's "main flaw" was that it didn't address Windows users?)
Hmm, could it be...
Michael J Ross wrote this one?
Why yes! Yes indeed!