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/utility/simplecontainer.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/utility/simplecontainer.php')
-rw-r--r-- | lib/private/appframework/utility/simplecontainer.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/appframework/utility/simplecontainer.php b/lib/private/appframework/utility/simplecontainer.php index a2d90138dfa..c6effed5b4b 100644 --- a/lib/private/appframework/utility/simplecontainer.php +++ b/lib/private/appframework/utility/simplecontainer.php @@ -7,7 +7,7 @@ namespace OC\AppFramework\Utility; * * SimpleContainer is a simple implementation of IContainer on basis of \Pimple */ -class SimpleContainer extends \Pimple implements \OCP\IContainer { +class SimpleContainer extends \Pimple\Container implements \OCP\IContainer { /** * @param string $name name of the service to query for @@ -35,10 +35,13 @@ class SimpleContainer extends \Pimple implements \OCP\IContainer { * @param bool $shared */ function registerService($name, \Closure $closure, $shared = true) { + if (!empty($this[$name])) { + unset($this[$name]); + } if ($shared) { - $this[$name] = \Pimple::share($closure); - } else { $this[$name] = $closure; + } else { + $this[$name] = parent::factory($closure); } } } |