Book Image

Drush User's Guide

By : Juan Pablo Novillo Requena
Book Image

Drush User's Guide

By: Juan Pablo Novillo Requena

Overview of this book

<p>Drush is a command line interface for Drupal. Most of the tasks for building and maintaining a website are repetitive and involve filling in forms on administration pages. The majority of these tasks can be achieved with a single Drush command, shortening the development and maintenance time of a project drastically.</p> <p><em>Drush User's Guide</em> will allow you to be more productive and efficient in building and maintaining your Drupal sites through the command line. You will learn to install Drush on different platforms, and manage and configure your Drupal site by learning how to use and create Drush commands.</p> <p>Become a Drush expert by exploring its command toolkit; customizing it to suit your needs, and extending it with contributed modules.</p> <p>The command line will allow you to download, enable and upgrade Drupal projects in seconds. Back up your files, code and data in one single file, clear the cache, interact with databases, and deploy sites to remote machines - all using simply the command line. Use Drush with your own commands or alter existing ones; and extend the toolkit with a long list of contributed modules.</p> <p><em>Drush User's Guide</em> has everything you need to extend your use of the command line to easily build and manage your Drupal sites.</p>
Table of Contents (10 chapters)

Type less and do more with Drush Site Aliases


At this point in the book, you may have already executed quite a few commands. Some of them need a long list of attributes and options in order to behave as your needs demand. Plus, you always have to take care of being at the root of your Drupal site. Moreover, if you use named sites in your sites folder instead of using the sites/default directory, you always have to add the --uri option or execute commands from the settings.php path. This is annoying and makes command typing tiresome and prone to error.

Enter Drush Site Aliases. A site alias is a short name that defines several options about a local or remote Drupal site such as where it is located, what is the username, host to log in via SSH, which sites has it defined at its sites directory, and many more. Think of it as an array with options.

We will first explain what are the benefits of setting up local site aliases, and then go one step further and start invoking Drush commands to...