use references for middleware to fix problems on 5.3
This commit is contained in:
parent
763da4258e
commit
4af72a076d
1 changed files with 3 additions and 2 deletions
|
@ -92,11 +92,12 @@ class DIContainer extends SimpleContainer implements IAppContainer{
|
|||
return new SecurityMiddleware($app, $c['Request']);
|
||||
});
|
||||
|
||||
$this['MiddlewareDispatcher'] = $this->share(function($c) {
|
||||
$middleWares = &$this->middleWares;
|
||||
$this['MiddlewareDispatcher'] = $this->share(function($c) use (&$middleWares) {
|
||||
$dispatcher = new MiddlewareDispatcher();
|
||||
$dispatcher->registerMiddleware($c['SecurityMiddleware']);
|
||||
|
||||
foreach($this->middleWares as $middleWare) {
|
||||
foreach($middleWares as $middleWare) {
|
||||
$dispatcher->registerMiddleware($c[$middleWare]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue