acquia_telemetry.module in Lightning Core 8.4
Same filename and directory in other branches
Install, update, and uninstall functions for the Acquia Telemetry module.
File
modules/acquia_telemetry/acquia_telemetry.moduleView source
<?php
/**
* @file
* Install, update, and uninstall functions for the Acquia Telemetry module.
*/
/**
* Implements hook_cron().
*/
function acquia_telemetry_cron() {
/** @var \Drupal\acquia_telemetry\Telemetry $telemetry_service */
$telemetry_service = \Drupal::service('acquia.telemetry');
$telemetry_service
->sendTelemetry('Drupal cron ran');
}
/**
* Implements hook_modules_installed().
*/
function acquia_telemetry_modules_installed(array $modules) {
/** @var \Drupal\acquia_telemetry\Telemetry $telemetry_service */
$telemetry_service = \Drupal::service('acquia.telemetry');
$installed_acquia_extensions = array_intersect($modules, $telemetry_service
->getAcquiaExtensionNames());
if ($installed_acquia_extensions) {
$event_properties = [
'installed_extensions' => array_values($installed_acquia_extensions),
];
$telemetry_service
->sendTelemetry('Acquia extensions installed', $event_properties);
}
}
/**
* Implements hook_modules_uninstalled().
*/
function acquia_telemetry_modules_uninstalled(array $modules) {
/** @var \Drupal\acquia_telemetry\Telemetry $telemetry_service */
$telemetry_service = \Drupal::service('acquia.telemetry');
$uninstalled_acquia_extensions = array_intersect($modules, $telemetry_service
->getAcquiaExtensionNames());
if ($uninstalled_acquia_extensions) {
$event_properties = [
'uninstalled_extensions' => array_values($uninstalled_acquia_extensions),
];
$telemetry_service
->sendTelemetry('Acquia extensions uninstalled', $event_properties);
}
}
Functions
Name | Description |
---|---|
acquia_telemetry_cron | Implements hook_cron(). |
acquia_telemetry_modules_installed | Implements hook_modules_installed(). |
acquia_telemetry_modules_uninstalled | Implements hook_modules_uninstalled(). |