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

Inspecting hook and function implementations


The Devel module (https://www.drupal.org/project/devel) has a couple of commands that are extremely useful when either looking for hook implementations or locating functions within a Drupal installation. We will see them in action in the following sections.

Browsing and navigating hook implementations

The fn- hook command lists all modules implementing a given hook name. This command comes in very handy when you want to implement a hook, but want to check before whether any other modules implement it and what do they do.

Let's take hook_cron() as an example. In Chapter 3, Running and Monitoring Tasks in Drupal Projects, we spoke about the importance of extracting some tasks out of hook_cron() and moved them into a custom Drush command so that they could run on their own process and scheduling. Let's go to our sample Drupal project and run the command to see which modules implement hook_cron(). We will assume that the Devel module is already downloaded...