Watching:

Inside Drush: What It Is and Why It's Useful


show more What is Drush and why should I use it? provides you with in-depth training on Developer. Taught by Jon Peck as part of the Simplified Drupal Sites with Drush show less
please wait ...

What is Drush and why should I use it?

Before describing what Drush is, I am going to take a step back and outline what Drupal is. From a high-level perspective, Drupal is an open-source content management framework that can be used to build a content management system. By providing a highly modularized architecture, the building blocks and the base framework can have functionality added through modules and designs in themes. Drupal is used to power websites of many different scales from simple static portfolios and brochures to interactive blogs, and enterprise grade web applications and corporate sites. The management of these sites and features is done almost exclusively through an administrative web interface. By providing an interface without requiring the use of a client other than a web browser virtually anyone can build and maintain a site. This versatility comes at a price. By providing an exclusive web interface Drupal site administrators are met with a number of frustrating limitations. Each page load consists of multiple transactions. The browser makes a request, the server generates a response, and the browser interprets the response. This is a number of steps. Markup is also transferred along with CSS and JavaScript, so on and so forth. Building a page on the server takes resources and time, depending on the number of modules that are enabled, a single page request can take over 128 megs of RAM and generate dozens of database queries. An additional overhead is introduced by providing a menu and form driven user interface. Options can be buried in a maze of menu items. To clear the cache for example, I'll have to log into the site, click on Configuration, click on Performance, then click Clear all caches. From start to finish, this manual process took a lot of work. Given that these interfaces are web- based, scripting actions is impractical due to the number of HTML elements in responses that need to be parsed and interacted with. Yes, testing framework such as Selenium provide a mechanism to script activities, but in this context it's like wanting a cup of tea and flying to India, instead of just putting the kettle on. Finally, web interfaces restrict access to potentially damaging activities. I hesitate calling this a limitation as there's hundreds of fantastically good reasons for preventing someone who has just enough knowledge to do damage from wreaking havoc. With that said, sometimes it's good to pop the hood if you know what needs to be done. With that context, I can describe what Drush is. Starting with the name, Drush, stands for Drupal shell. A shell is a software that provides an interface to a particular component, typically an operating system. Shells can be command-line and graphical. Drush is a command-line shell. In particular, Drush can be used as a scripting interface, allowing groups of actions to be performed with a single command. Drush has two official pages. A website drush.org, which primarily consists of generated documentation any project page on drupal.org. Drush has been around since 2006 when it was initially developed by Arto Bendiken to manage Drupal 4.7 sites. A partial redesign and reimplementation for Drupal 5 in 2007 increased visibility of the project, which has since evolved into a full Drupal.org project maintained and expanded by the community. Today Drush supports Drupal 6, 7 and 8, and works on Linux, Mac OS, and Windows Operating Systems. Why use the command-line tool like Drush when functionality is available elsewhere in the Graphical User Interface? Most simply, Drush will save time with sheer speed and versatility. For example, clearing the cache can be done with one simple command instead of navigating through multiple menus and interfaces. Using the scriptable capabilities operations such as downloading and installing modules can be automated and placed in version control. Providing the tools that interact with Drupal from the ground up, the overhead of browser transactions is eliminated and precise actions can be performed with less chance of missing a checkbox or option. Drush is a fantastic tool that I use on a daily basis, but it has some drawbacks in terms of approachability. The documentation for Drush, while thorough and improving, can be intimidating and obtuse for people who don't live, breathe, and code a Drupal. Drush.org the homepage is an example of this. It's a very useful source for information, but it's literally dozens of commands and all of their arguments are displayed on one page. Where to start? My goal is to educate and inform about how Drush can be practically leveraged to administer Drupal sites. To do that, I will be building a fully functional Drupal site from the ground up. This includes module installation and administration, user and cache management for troubleshooting and maintenance, to copying entire sites. I will be performing all demonstrations in this course using Drush 5.8. If you look at the Drupal.org homepage, you will see the version displayed as 7.x-5.8. This is due to the way drupal.org versions files. Drush 5.8 is compatible with both Drupal 7 and Drupal 6. In this course, I will demonstrate using Drupal 7. The tools and techniques described in this course are common core functionality that should be safely future proof. In the next segments I will demonstrate how to install Drush. The README.TXT included with Drush provides installation instructions as well. Refer to them for additional guidance if needed. I'll be upfront. Installing Drush can sometimes be complicated and using Drush is actually easier than installing it. With that said, most of the time installation is easy and straightforward. I will demonstrate multiple techniques that will cover the vast majority of system setups and installation options. Not all steps are necessary for every system. Use your best judgment to determine which combination is best for your needs.

What is Drush and why should I use it?
Video duration: 6m 17s 1h 22m Intermediate

Viewers:

What is Drush and why should I use it? provides you with in-depth training on Developer. Taught by Jon Peck as part of the Simplified Drupal Sites with Drush

Subjects:
Developer Web
Software:
Drupal Drush
Author:
please wait ...