You are here

function monitoring_update_8102 in Monitoring 8

Disable user sensors, if dblog is not installed.

File

./monitoring.install, line 95
Monitoring base install file.

Code

function monitoring_update_8102() {
  if (!\Drupal::moduleHandler()
    ->moduleExists('dblog')) {
    $sensor_configs = SensorConfig::loadMultiple([
      'user_failed_logins',
      'user_session_logouts',
      'user_successful_logins',
      'user_void_failed_logins',
    ]);
    foreach ($sensor_configs as $sensor) {
      $sensor
        ->delete();
    }
  }
}