Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename $location to $path
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb authored and Backportbot committed Sep 26, 2019
commit 2b090ffa6f917be77ed48c185a079b448b14b79b
14 changes: 7 additions & 7 deletions apps/files_external/lib/Lib/Storage/AmazonS3.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,30 +148,30 @@ private function headObject($key) {
* Implementation from flysystem-aws-s3-v3:
* https://github.com/thephpleague/flysystem-aws-s3-v3/blob/8241e9cc5b28f981e0d24cdaf9867f14c7498ae4/src/AwsS3Adapter.php#L670-L694
*
* @param $location
* @param $path
* @return bool
* @throws \Exception
*/
protected function doesDirectoryExist($location) {
if (!isset($this->directoryCache[$location])) {
protected function doesDirectoryExist($path) {
if (!isset($this->directoryCache[$path])) {
// Maybe this isn't an actual key, but a prefix.
// Do a prefix listing of objects to determine.
try {
$result = $this->getConnection()->listObjects([
'Bucket' => $this->bucket,
'Prefix' => rtrim($location, '/') . '/',
'Prefix' => rtrim($path, '/') . '/',
'MaxKeys' => 1,
]);
$this->directoryCache[$location] = $result['Contents'] || $result['CommonPrefixes'];
$this->directoryCache[$path] = $result['Contents'] || $result['CommonPrefixes'];
} catch (S3Exception $e) {
if ($e->getStatusCode() === 403) {
$this->directoryCache[$location] = false;
$this->directoryCache[$path] = false;
}
throw $e;
}
}

return $this->directoryCache[$location];
return $this->directoryCache[$path];
}

/**
Expand Down