diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-03 13:10:03 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-11-03 16:57:16 +0100 |
commit | 994768d99f0c0ea0e50f30774005a75e7533e105 (patch) | |
tree | 9f708f8c3df7b581671af81378dc5752a9a8dcc2 /lib/private/appframework/dependencyinjection/dicontainer.php | |
parent | f8f38b06dfef0af2555124cf0d1ec55402aa8c8c (diff) | |
download | nextcloud-server-994768d99f0c0ea0e50f30774005a75e7533e105.tar.gz nextcloud-server-994768d99f0c0ea0e50f30774005a75e7533e105.zip |
Update Pimple to V3.0
Diffstat (limited to 'lib/private/appframework/dependencyinjection/dicontainer.php')
-rw-r--r-- | lib/private/appframework/dependencyinjection/dicontainer.php | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/private/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index f7fee347215..98525ed3202 100644 --- a/lib/private/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php @@ -59,14 +59,14 @@ class DIContainer extends SimpleContainer implements IAppContainer{ $this->registerParameter('ServerContainer', \OC::$server); - $this['API'] = $this->share(function($c){ + $this->registerService('API', function($c){ return new API($c['AppName']); }); /** * Http */ - $this['Request'] = $this->share(function($c) { + $this->registerService('Request', function($c) { /** @var $c SimpleContainer */ /** @var $server SimpleContainer */ $server = $c->query('ServerContainer'); @@ -75,7 +75,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ return $server->getRequest(); }); - $this['Protocol'] = $this->share(function($c){ + $this->registerService('Protocol', function($c){ if(isset($_SERVER['SERVER_PROTOCOL'])) { return new Http($_SERVER, $_SERVER['SERVER_PROTOCOL']); } else { @@ -83,7 +83,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ } }); - $this['Dispatcher'] = $this->share(function($c) { + $this->registerService('Dispatcher', function($c) { return new Dispatcher( $c['Protocol'], $c['MiddlewareDispatcher'], @@ -97,7 +97,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ * Middleware */ $app = $this; - $this['SecurityMiddleware'] = $this->share(function($c) use ($app){ + $this->registerService('SecurityMiddleware', function($c) use ($app){ return new SecurityMiddleware( $c['Request'], $c['ControllerMethodReflector'], @@ -110,14 +110,14 @@ class DIContainer extends SimpleContainer implements IAppContainer{ ); }); - $this['CORSMiddleware'] = $this->share(function($c) { + $this->registerService('CORSMiddleware', function($c) { return new CORSMiddleware( $c['Request'], $c['ControllerMethodReflector'] ); }); - $this['SessionMiddleware'] = $this->share(function($c) use ($app) { + $this->registerService('SessionMiddleware', function($c) use ($app) { return new SessionMiddleware( $c['Request'], $c['ControllerMethodReflector'], @@ -126,7 +126,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{ }); $middleWares = &$this->middleWares; - $this['MiddlewareDispatcher'] = $this->share(function($c) use (&$middleWares) { + $this->registerService('MiddlewareDispatcher', function($c) use (&$middleWares) { $dispatcher = new MiddlewareDispatcher(); $dispatcher->registerMiddleware($c['SecurityMiddleware']); $dispatcher->registerMiddleware($c['CORSMiddleware']); @@ -143,11 +143,11 @@ class DIContainer extends SimpleContainer implements IAppContainer{ /** * Utilities */ - $this['TimeFactory'] = $this->share(function($c){ + $this->registerService('TimeFactory', function($c){ return new TimeFactory(); }); - $this['ControllerMethodReflector'] = $this->share(function($c) { + $this->registerService('ControllerMethodReflector', function($c) { return new ControllerMethodReflector(); }); |