Version 1
[yaffs-website] / web / modules / contrib / devel / webprofiler / webprofiler.module
diff --git a/web/modules/contrib/devel/webprofiler/webprofiler.module b/web/modules/contrib/devel/webprofiler/webprofiler.module
new file mode 100644 (file)
index 0000000..01e9b95
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * @file
+ * Legacy Webprofiler module file.
+ */
+
+/**
+ * Implements hook_theme().
+ */
+function webprofiler_theme() {
+  return [
+    'webprofiler_loader' => [
+      '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();
+  }
+}