What is it?
The module "Doctor" is "listening" to a doctor listen item that create during your module actions.

How does it work?
The doctor create an entity called doctor. When running the drush command drush doctor-listen(AKA dols), the module will wait for a doctor entity entry to create and will present the data on the CLI. If there any items that created when the doctor did not listen, the next time the you initialized the command, they will be displayed for in the CLI.

/**
 * Implements hook_node_insert().
 */
function doctor_example_node_insert($node) {
  doctor_create(
    array(
      'wrapper' => entity_metadata_wrapper('node', $node),
    )
  )->save();
}

/**
 * Doctor listener callback function.
 *
 * @param $data
 *  The un-serialized data listener item.
 */
function doctor_example_doctor_listener_callback($data) {
  $wrapper = $data['wrapper'];
  $params = array(
    '@title' => $wrapper->label(),
    '@user' => $wrapper->author->label(),
  );
  drush_print(dt('The user @user posted a node with the title: @title', $params));
}

drush doctor-listen --timeout=120

Why is this use full?
Sometimes the dpm messages are not available for us(AJAX callbacks) and sometimes we just need to debug during a drush script when debug is a little bit hard. In those cases, you can turn on the doctor and he will be listen to you.

This is also another way to debug your live, dev and test code stages with the
drush remote connect.

Install and usage
Enable the module just like any other module. There is a module called Doctor example that show how to implements display handler in the drush CLI. If you did not implemented any display handler, the module will use the function drush_print_r that is the equivalent for php standard php print_r.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • Module categories: Developer Tools
  • Created by RoySegall on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases