Book Image

Drush for Developers - Second Edition

By : Juan Pablo Novillo Requena, Juan P Novillo Requena
Book Image

Drush for Developers - Second Edition

By: Juan Pablo Novillo Requena, Juan P Novillo Requena

Overview of this book

Table of Contents (13 chapters)
Drush for Developers Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Keeping Database Configuration and Code Together
Index

Adding site alias support to the update path


In Chapter 2, Keeping Database Configuration and Code Together, we introduced the update path as a list of steps to update a database so that it gets in sync with the exported configuration in code. Then, in Chapter 4, Error Handling and Debugging, we made the update path more flexible by wrapping it in a Drush command and taking advantage of Drush's command hooks in order to perform steps before and after it runs. In this chapter, we will go one step further by implementing the following improvements:

  • Make sure that the registry-rebuild and features-revert-all commands are available.

  • Add an example in the command definition using a site alias.

  • Implement error handling by inspecting the returned status from each command. If a command fails, we will stop the process immediately.

Inspecting the command implementation and hooks

We will now go through our update path command, located at sites/all/drush/updatepath.drush.inc, explaining the new features...