mongodb_watchdog.install in MongoDB 8
Same filename and directory in other branches
MongoDB watchdog install file.
File
mongodb_watchdog/mongodb_watchdog.installView source
<?php
/**
* @file
* MongoDB watchdog install file.
*/
/**
* Implements hook_install().
*/
function mongodb_watchdog_install() {
/** @var \Drupal\mongodb\Logger\Logger $logger */
$logger = \Drupal::service('mongo.logger');
$logger
->ensureIndexes();
}
/**
* Implements hook_uninstall().
*
* Drop /all/ the watchdog collections.
*/
function mongodb_watchdog_uninstall() {
/** @var \Drupal\mongodb\Logger\Logger $logger */
$logger = \Drupal::service('mongo.logger');
$count = $logger
->uninstall();
if ($count) {
drupal_set_message(\Drupal::translation()
->formatPlural($count, 'Dropped 1 watchdog collection', 'Dropped @count watchdog collections'));
}
}
Functions
Name | Description |
---|---|
mongodb_watchdog_install | Implements hook_install(). |
mongodb_watchdog_uninstall | Implements hook_uninstall(). |