summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-10-22 21:48:22 +0200
committerVincent Petry <pvince81@owncloud.com>2014-10-22 22:17:07 +0200
commit71dce48bd3f4d75156be30670f2e6752c0cb97c5 (patch)
treea07db4f237eea9b68f42617ca75d1ed8259b17d1 /apps/files_external
parente9ec45ddd1c965523f3e232a9cb0ad438750ddec (diff)
downloadnextcloud-server-71dce48bd3f4d75156be30670f2e6752c0cb97c5.tar.gz
nextcloud-server-71dce48bd3f4d75156be30670f2e6752c0cb97c5.zip
Fix S3 connection
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/lib/amazons3.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index da919236f8f..22128eb19c0 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -46,6 +46,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
*/
private static $tmpFiles = array();
/**
+ * @var array
+ */
+ private $params;
+ /**
* @var bool
*/
private $test = false;
@@ -101,7 +105,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$this->updateLegacyId($params);
$this->bucket = $params['bucket'];
- $scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
$this->test = isset($params['test']);
$this->timeout = (!isset($params['timeout'])) ? 15 : $params['timeout'];
$this->rescanDelay = (!isset($params['rescanDelay'])) ? 10 : $params['rescanDelay'];
@@ -110,7 +113,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
if (!isset($params['port']) || $params['port'] === '') {
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
}
- $base_url = $scheme . '://' . $params['hostname'] . ':' . $params['port'] . '/';
+ $this->params = $params;
}
/**
@@ -549,11 +552,14 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return $this->connection;
}
+ $scheme = ($this->params['use_ssl'] === 'false') ? 'http' : 'https';
+ $base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/';
+
$this->connection = S3Client::factory(array(
- 'key' => $params['key'],
- 'secret' => $params['secret'],
+ 'key' => $this->params['key'],
+ 'secret' => $this->params['secret'],
'base_url' => $base_url,
- 'region' => $params['region']
+ 'region' => $this->params['region']
));
if (!$this->connection->isValidBucketName($this->bucket)) {