php 5.3 compatibility for \OC\AppFramework\DependencyInjection\DIContainer

This commit is contained in:
Thomas Müller 2013-10-08 23:14:08 +02:00
parent 8a06f2e128
commit 7bd5352509

View file

@ -89,11 +89,12 @@ class DIContainer extends SimpleContainer implements IAppContainer{
return new SecurityMiddleware($c['API'], $c['Request']); return new SecurityMiddleware($c['API'], $c['Request']);
}); });
$this['MiddlewareDispatcher'] = $this->share(function($c){ $middleWares = $this->middleWares;
$this['MiddlewareDispatcher'] = $this->share(function($c) use ($middleWares) {
$dispatcher = new MiddlewareDispatcher(); $dispatcher = new MiddlewareDispatcher();
$dispatcher->registerMiddleware($c['SecurityMiddleware']); $dispatcher->registerMiddleware($c['SecurityMiddleware']);
foreach($this->middleWares as $middleWare) { foreach($middleWares as $middleWare) {
$dispatcher->registerMiddleware($middleWare); $dispatcher->registerMiddleware($middleWare);
} }