You are here

function new_relic_rpm_module_deploy in New Relic 7

Same name and namespace in other branches
  1. 8 new_relic_rpm.module \new_relic_rpm_module_deploy()
  2. 2.x new_relic_rpm.module \new_relic_rpm_module_deploy()
  3. 2.0.x new_relic_rpm.module \new_relic_rpm_module_deploy()

Log module enable/disable actions as a deploy call to New Relic.

Parameters

$new_modules:

$disable_modules:

2 calls to new_relic_rpm_module_deploy()
new_relic_rpm_modules_disabled in ./new_relic_rpm.module
Implements hook_modules_disabled().
new_relic_rpm_modules_enabled in ./new_relic_rpm.module
Implements hook_modules_enabled().

File

./new_relic_rpm.module, line 384
Drupal module implementing New Relic.

Code

function new_relic_rpm_module_deploy($new_modules, $disable_modules) {

  // If the API Key and/or App name is/are not set, there is no sense in
  // attempting to create deployments.
  if (variable_get('new_relic_rpm_module_deployment', FALSE) && ini_get('newrelic.appname') && variable_get('new_relic_rpm_api_key', '')) {
    $modules_installed = !empty($new_modules);
    $modules_removed = !empty($disable_modules);
    if ($modules_installed) {
      $m_inst = 'Modules Installed: ' . implode(', ', $new_modules) . "\n";
    }
    else {
      $m_inst = '';
    }
    if ($modules_removed) {
      $m_remv = 'Modules Removed: ' . implode(', ', $disable_modules) . "\n";
    }
    else {
      $m_remv = '';
    }
    _new_relic_rpm_deploy('Drupal Module Install/Uninstall', 'Drupal modules were installed: ' . ($modules_installed ? 'YES' : 'NO') . ' and uninstalled: ' . ($modules_removed ? 'YES' : 'NO'), $m_inst . $m_remv);
  }
}