1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Additional functionality for Middleware extender

Implements the remove, insertBefore, insertAfter and replace
functionality for middlewares.

The IoC container now holds one array of middleware (bindings) per
frontend stack - the extender operates on that array, before it is
wrapped in a middleware "pipe".

Fixes #1957, closes #1971.
This commit is contained in:
Matthew Kilgore
2020-01-24 21:20:08 +01:00
committed by Franz Liedke
parent a330a8fa28
commit 8dd3bd420b
5 changed files with 125 additions and 47 deletions

View File

@@ -63,9 +63,9 @@ class InstalledApp implements AppInterface
$pipe->pipe(new OriginalMessages);
$pipe->pipe(
new BasePathRouter([
$this->subPath('api') => 'flarum.api.middleware',
$this->subPath('admin') => 'flarum.admin.middleware',
'/' => 'flarum.forum.middleware',
$this->subPath('api') => 'flarum.api.handler',
$this->subPath('admin') => 'flarum.admin.handler',
'/' => 'flarum.forum.handler',
])
);
$pipe->pipe(new RequestHandler($this->container));