Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / devel / webprofiler / src / WebprofilerServiceProvider.php
index 20b67f0b53c11e826cc6523dc90e0000a3f40aa2..3ba1ff0682a33db24ee06ed76250451f6104503d 100644 (file)
@@ -28,7 +28,6 @@ class WebprofilerServiceProvider extends ServiceProviderBase {
     $container->addCompilerPass(new StoragePass());
 
     $container->addCompilerPass(new ServicePass(), PassConfig::TYPE_AFTER_REMOVING);
-    $container->addCompilerPass(new EventPass(), PassConfig::TYPE_AFTER_REMOVING);
     $container->addCompilerPass(new DecoratorPass(), PassConfig::TYPE_AFTER_REMOVING);
 
     $modules = $container->getParameter('container.modules');
@@ -57,7 +56,7 @@ class WebprofilerServiceProvider extends ServiceProviderBase {
           'priority' => 78,
         ]);
     }
-    
+
     // Add TranslationsDataCollector only if Locale module is enabled.
     if (isset($modules['locale'])) {
       $container->register('webprofiler.translations', 'Drupal\webprofiler\DataCollector\TranslationsDataCollector')
@@ -105,5 +104,14 @@ class WebprofilerServiceProvider extends ServiceProviderBase {
     // Replace the regular string_translation service with a traceable one.
     $container->getDefinition('string_translation')
       ->setClass('Drupal\webprofiler\StringTranslation\TranslationManagerWrapper');
+
+    // Replace the regular event_dispatcher service with a traceable one.
+    $container->getDefinition('event_dispatcher')
+      ->setClass('Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher')
+      ->addMethodCall('setStopwatch', [new Reference('stopwatch')]);
+
+    $container->getDefinition('http_kernel.basic')
+      ->replaceArgument(1, new Reference('webprofiler.debug.controller_resolver'));
   }
+
 }