[Pkg-owncloud-commits] [owncloud] 40/46: Fix S3 connection

David Prévot taffit at moszumanska.debian.org
Fri Oct 24 15:11:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 6a8c41754fdcd4dee747b92406aca0798c41dc7a
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Wed Oct 22 21:48:22 2014 +0200

    Fix S3 connection
---
 apps/files_external/lib/amazons3.php | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index c73860d..77c5f82 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;
 	}
 
 	/**
@@ -548,11 +551,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)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list