diff options
author | Robin Appelman <robin@icewind.nl> | 2018-02-12 15:08:27 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-02-19 19:41:16 +0100 |
commit | 817f2f8f49aec409da832219f43663793e1933a8 (patch) | |
tree | 7e4db6141f7974341937e64be8041db2209277ce /lib/private/Files/ObjectStore/Swift.php | |
parent | 3192efc415ac6d71683994afdd8f510e3480b42f (diff) | |
download | nextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.tar.gz nextcloud-server-817f2f8f49aec409da832219f43663793e1933a8.zip |
adjust swift external storage to new openstack sdk
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/ObjectStore/Swift.php')
-rw-r--r-- | lib/private/Files/ObjectStore/Swift.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/private/Files/ObjectStore/Swift.php b/lib/private/Files/ObjectStore/Swift.php index 1f93954c774..4451fbcc750 100644 --- a/lib/private/Files/ObjectStore/Swift.php +++ b/lib/private/Files/ObjectStore/Swift.php @@ -41,24 +41,21 @@ class Swift implements IObjectStore { */ private $container = null; - /** @var SwiftConnectionFactory */ + /** @var SwiftFactory */ private $swiftFactory; - public function __construct($params) { - $this->swiftFactory = new SwiftConnectionFactory(\OC::$server->getMemCacheFactory()->createDistributed('swift::')); + public function __construct($params, SwiftFactory $connectionFactory = null) { + $this->swiftFactory = $connectionFactory ?: new SwiftFactory(\OC::$server->getMemCacheFactory()->createDistributed('swift::'), $params); $this->params = $params; } /** * @return \OpenStack\ObjectStore\v1\Models\Container * @throws StorageAuthException - * @throws \Exception + * @throws \OCP\Files\StorageNotAvailableException */ private function getContainer() { - if (is_null($this->container)) { - $this->container = $this->swiftFactory->getContainer($this->params); - } - return $this->container; + return $this->swiftFactory->getContainer(); } /** |