Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Drush for Developers - Second Edition
  • Table Of Contents Toc
Drush for Developers - Second Edition

Drush for Developers - Second Edition

By : Juan Pablo Novillo Requena, Juan P Novillo Requena
4.5 (6)
close
close
Drush for Developers - Second Edition

Drush for Developers - Second Edition

4.5 (6)
By: Juan Pablo Novillo Requena, Juan P Novillo Requena

Overview of this book

This book is a best fit for backend developers with a basic knowledge of Drupal's APIs and some experience using the command line. Perhaps you already worked on one or two Drupal projects, but have never dived deep into Drush's toolset. In any case, this book will give you a lot of advice by covering real-world challenges in Drupal projects that can be solved using Drush.
Table of Contents (8 chapters)
close
close
2
2. Keeping Database Configuration and Code Together
7
Index

Rolling back when an error happens


When drush_set_error() is called during a command execution, the rollback mechanism jumps into action. The rollback mechanism gives us a chance to exit gracefully if something goes wrong. It is especially useful when we only want to perform a final action if a command is completed successfully. Drush itself uses the rollback mechanism when dealing with core and module upgrades, performing actions such as restoring original files back in place, and deleting the downloaded files of the new version if there is an error.

Here is the full sequence of invocations for a given command. In the following list, hook is the filename where the Drush command is implemented (excluding the .drush.inc extension) and COMMAND is the actual command name:

# 1.  hook_drush_init()
# 2.  drush_COMMAND_init()
# 3.  drush_hook_COMMAND_pre_validate()
# 4.  drush_hook_COMMAND_validate()
# 5.  drush_hook_pre_COMMAND()
# 6.  drush_hook_COMMAND()
# 7.  drush_hook_post_COMMAND()
# 8. hook_drush_exit...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Drush for Developers - Second Edition
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon