Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit b1d4c36

Browse files
committed
Another "incompatible declaration" error was silently breaking s3 on PHP7.
1 parent 98b350f commit b1d4c36

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

core/src/plugins/access.s3/S3AccessWrapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ protected static function getClientForContext(ContextInterface $ctx, $registerSt
106106
$config["endpoint"] = $baseURL;
107107
}
108108
require_once("S3Client.php");
109-
$s3Client = new S3Client($config);
110-
$s3Client->registerStreamWrapper($repoObject->getId());
109+
$s3Client = new S3Client($config, $repoObject->getId());
110+
$s3Client->registerStreamWrapper();
111111
self::$clients[$repoObject->getId()] = $s3Client;
112112
}
113113
return self::$clients[$repoObject->getId()];

core/src/plugins/access.s3/S3Client.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,25 @@
3232
*/
3333
class S3Client extends AwsS3Client
3434
{
35+
private $repositoryId;
36+
37+
/**
38+
* S3Client constructor.
39+
* @param array $args
40+
* @param $repositoryId
41+
*/
42+
public function __construct(array $args, $repositoryId)
43+
{
44+
$this->repositoryId = $repositoryId;
45+
parent::__construct($args);
46+
}
47+
3548
/**
3649
* Register a new stream wrapper who overwrite the Amazon S3 stream wrapper with this client instance.
37-
* @param string $repositoryId
38-
* @return $this|void
50+
* @return void
3951
*/
40-
public function registerStreamWrapper($repositoryId)
52+
public function registerStreamWrapper()
4153
{
42-
StreamWrapper::register($this, "s3.".$repositoryId, new S3CacheService());
54+
StreamWrapper::register($this, "s3.".$this->repositoryId, new S3CacheService());
4355
}
4456
}

0 commit comments

Comments
 (0)