summaryrefslogtreecommitdiff
path: root/app/Http/Middleware/BootModules.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-10-08 07:19:33 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-10-09 12:01:56 +0100
commit71378461661e7642e52abe7d41c9cfffb3e5369b (patch)
tree3542baf9d94e2361fcf3858badef30c75048b974 /app/Http/Middleware/BootModules.php
parent01202f8037e516171a36f999e52383b38b2f3b10 (diff)
downloadwebtrees-71378461661e7642e52abe7d41c9cfffb3e5369b.tar.gz
webtrees-71378461661e7642e52abe7d41c9cfffb3e5369b.tar.bz2
webtrees-71378461661e7642e52abe7d41c9cfffb3e5369b.zip
Working on routing
Diffstat (limited to 'app/Http/Middleware/BootModules.php')
-rw-r--r--app/Http/Middleware/BootModules.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/app/Http/Middleware/BootModules.php b/app/Http/Middleware/BootModules.php
index f6c928c8cf..1e33c2018f 100644
--- a/app/Http/Middleware/BootModules.php
+++ b/app/Http/Middleware/BootModules.php
@@ -25,6 +25,7 @@ use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
+
use function method_exists;
/**
@@ -58,18 +59,7 @@ class BootModules implements MiddlewareInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
- $bootable_modules = $this->module_service->all()->filter(static function (ModuleInterface $module) {
- return method_exists($module, 'boot');
- });
-
- foreach ($bootable_modules as $module) {
- // Only bootstrap the current theme.
- if ($module instanceof ModuleThemeInterface && $module !== $this->theme) {
- continue;
- }
-
- app()->dispatch($module, 'boot');
- }
+ $this->module_service->bootModules($this->theme);
return $handler->handle($request);
}