You are here

public static function Message::varDumpToDrush in Hook Update Deploy Tools 8

Same name and namespace in other branches
  1. 7 src/Message.php \HookUpdateDeployTools\Message::varDumpToDrush()

Dumps a var to drush terminal if run by drush.

Parameters

mixed $var: Any variable value to output.

string $var_id: An optional string to identify what is being output.

1 call to Message::varDumpToDrush()
site_deploy_install in boilerplate/install.php
Implements hook_install().

File

src/Message.php, line 116

Class

Message

Namespace

HookUpdateDeployTools

Code

public static function varDumpToDrush($var, $var_id = 'VAR DUMPs') {

  // Check to see if this is run by drush and output is desired.
  if (drupal_is_cli()) {
    drush_print("{$var_id}: \n", 0);
    if (!empty($var)) {
      drush_print_r($var);
    }
    else {
      drush_print("This variable was EMPTY. \n", 1);
    }
  }
}