X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Fwebprofiler.module;fp=web%2Fmodules%2Fcontrib%2Fdevel%2Fwebprofiler%2Fwebprofiler.module;h=01e9b95f17b14633a8bdc08cfc63a7203d5c30f1;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/devel/webprofiler/webprofiler.module b/web/modules/contrib/devel/webprofiler/webprofiler.module new file mode 100644 index 000000000..01e9b95f1 --- /dev/null +++ b/web/modules/contrib/devel/webprofiler/webprofiler.module @@ -0,0 +1,51 @@ + [ + 'template' => 'Profiler/webprofiler_loader', + 'variables' => ['token' => NULL, 'profiler_url' => NULL], + ], + 'webprofiler_toolbar' => [ + 'template' => 'Profiler/webprofiler_toolbar', + 'variables' => [ + 'token' => NULL, + 'toolbar' => NULL, + ], + ], + 'webprofiler_panel' => [ + 'template' => 'Profiler/webprofiler_panel', + 'variables' => [ + 'panel' => NULL, + ], + ], + 'webprofiler_dashboard' => [ + 'template' => 'Profiler/webprofiler_dashboard', + 'variables' => [ + 'profile' => [], + 'panels' => [], + 'spinner_path' => NULL, + ], + ], + ]; +} + +/** + * Implements hook_cache_flush(). + */ +function webprofiler_cache_flush() { + $config = \Drupal::configFactory()->get('webprofiler.config'); + + if ($config->get('purge_on_cache_clear')) { + $profiler = \Drupal::service('profiler'); + $profiler->purge(); + } +}