summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-27 17:15:26 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-27 17:15:26 +0200
commit57f37c876b59d11dae8b4325bed5fa57de52ecd4 (patch)
tree00fcbc102baec424294bd9b711361e66697f30e8 /lib
parentadff34cb8a7c2e2a6046e4fe28da3a77cd6492ca (diff)
downloadnextcloud-server-57f37c876b59d11dae8b4325bed5fa57de52ecd4.tar.gz
nextcloud-server-57f37c876b59d11dae8b4325bed5fa57de52ecd4.zip
delay middleware registrations
Diffstat (limited to 'lib')
-rw-r--r--lib/appframework/dependencyinjection/dicontainer.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/appframework/dependencyinjection/dicontainer.php b/lib/appframework/dependencyinjection/dicontainer.php
index 54878266939..380a0ee6d4a 100644
--- a/lib/appframework/dependencyinjection/dicontainer.php
+++ b/lib/appframework/dependencyinjection/dicontainer.php
@@ -40,6 +40,10 @@ use OCP\IServerContainer;
class DIContainer extends SimpleContainer implements IAppContainer{
+ /**
+ * @var array
+ */
+ private $middleWares;
/**
* Put your class dependencies in here
@@ -89,6 +93,10 @@ class DIContainer extends SimpleContainer implements IAppContainer{
$dispatcher = new MiddlewareDispatcher();
$dispatcher->registerMiddleware($c['SecurityMiddleware']);
+ foreach($this->middleWares as $middleWare) {
+ $dispatcher->registerMiddleware($middleWare);
+ }
+
return $dispatcher;
});
@@ -125,10 +133,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{
* @return boolean
*/
function registerMiddleWare(IMiddleWare $middleWare) {
- /** @var $dispatcher MiddlewareDispatcher */
- $dispatcher = $this->query('MiddlewareDispatcher');
- $dispatcher->registerMiddleware($middleWare);
-
+ array_push($this->middleWares, $middleWare);
}
/**