You are here

function webprofiler_cache_flush in Devel 8.3

Same name and namespace in other branches
  1. 8 webprofiler/webprofiler.module \webprofiler_cache_flush()
  2. 8.2 webprofiler/webprofiler.module \webprofiler_cache_flush()
  3. 4.x webprofiler/webprofiler.module \webprofiler_cache_flush()

Implements hook_cache_flush().

File

webprofiler/webprofiler.module, line 44
Legacy Webprofiler module file.

Code

function webprofiler_cache_flush() {
  $config = \Drupal::configFactory()
    ->get('webprofiler.config');
  if ($config
    ->get('purge_on_cache_clear')) {
    $profiler = \Drupal::service('profiler');
    $profiler
      ->purge();
  }
}