From eae8500a86f99fc399d06a3a6c6db4a3877f4a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 10 Dec 2015 14:37:53 +0100 Subject: [PATCH 1/2] make url type configurable --- config/config.sample.php | 2 ++ lib/private/files/objectstore/swift.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/config.sample.php b/config/config.sample.php index 9b10792944..89b6f6833c 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -974,6 +974,8 @@ $CONFIG = array( // dev-/trystack uses swift by default, the lib defaults to 'cloudFiles' // if omitted 'serviceName' => 'swift', + // The Interface / url Type, optional + 'urlType' => 'internal' ), ), diff --git a/lib/private/files/objectstore/swift.php b/lib/private/files/objectstore/swift.php index 89ef40360a..162b17a066 100644 --- a/lib/private/files/objectstore/swift.php +++ b/lib/private/files/objectstore/swift.php @@ -77,7 +77,11 @@ class Swift implements IObjectStore { $serviceName = $this->params['serviceName']; } - $this->objectStoreService = $this->client->objectStoreService($serviceName, $this->params['region']); + $urlType = null; + if ($this->params['urlType']) { + $urlType = $this->params['urlType']; + } + $this->objectStoreService = $this->client->objectStoreService($serviceName, $this->params['region'], $urlType); try { $this->container = $this->objectStoreService->getContainer($this->params['container']); From 3f101039b9621837f9405f1b58357d82a712a3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Mon, 4 Jan 2016 16:38:45 +0100 Subject: [PATCH 2/2] add isset for optional params --- lib/private/files/objectstore/swift.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/private/files/objectstore/swift.php b/lib/private/files/objectstore/swift.php index 162b17a066..50bb0d9adf 100644 --- a/lib/private/files/objectstore/swift.php +++ b/lib/private/files/objectstore/swift.php @@ -73,12 +73,13 @@ class Swift implements IObjectStore { // the OpenCloud client library will default to 'cloudFiles' if $serviceName is null $serviceName = null; - if ($this->params['serviceName']) { + if (isset($this->params['serviceName'])) { $serviceName = $this->params['serviceName']; } + // the OpenCloud client library will default to 'publicURL' if $urlType is null $urlType = null; - if ($this->params['urlType']) { + if (isset($this->params['urlType'])) { $urlType = $this->params['urlType']; } $this->objectStoreService = $this->client->objectStoreService($serviceName, $this->params['region'], $urlType);