From 846b1a712125ea6a76451278030716ae324c373c Mon Sep 17 00:00:00 2001 From: Matthew Baggett Date: Fri, 13 Nov 2020 10:49:18 +0100 Subject: [PATCH] Add ServerTimingMiddleware --- composer.json | 1 + src/App.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/composer.json b/composer.json index b4aaf4b..25aa0d0 100644 --- a/composer.json +++ b/composer.json @@ -71,6 +71,7 @@ "symfony/twig-bridge": "^5.1", "symfony/yaml": "^5.1", "thecodingmachine/phpstan-strict-rules": "^0.12", + "tuupola/server-timing-middleware": "^0.8.2", "twig/intl-extra": "^3.0" }, "suggest": { diff --git a/src/App.php b/src/App.php index 76668a2..9124955 100644 --- a/src/App.php +++ b/src/App.php @@ -41,6 +41,7 @@ use Symfony\Bridge\Twig\Extension as SymfonyTwigExtensions; use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Translation; +use Tuupola\Middleware\ServerTimingMiddleware; use Twig; use Twig\Loader\FilesystemLoader; @@ -97,6 +98,8 @@ class App $this->debugBar['time']->startMeasure('interrogateTranslations', 'Time to interrogate translation files'); $this->interrogateTranslations(); $this->debugBar['time']->stopMeasure('interrogateTranslations'); + + $this->app->add(new ServerTimingMiddleware()); } public function getCachePath(): string