@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | 'MaxKeys' => 1, |
| 166 | 166 | 'Delimiter' => '/', |
| 167 | 167 | ]); |
| 168 | - $this->directoryCache[$path] = ($result['Contents'][0]['Key'] === rtrim($path, '/') . '/') || $result['CommonPrefixes']; |
|
| 168 | + $this->directoryCache[$path] = ($result['Contents'][0]['Key'] === rtrim($path, '/').'/') || $result['CommonPrefixes']; |
|
| 169 | 169 | } catch (S3Exception $e) { |
| 170 | 170 | if ($e->getStatusCode() === 403) { |
| 171 | 171 | $this->directoryCache[$path] = false; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @param array $params |
| 185 | 185 | */ |
| 186 | 186 | public function updateLegacyId(array $params) { |
| 187 | - $oldId = 'amazon::' . $params['key'] . md5($params['secret']); |
|
| 187 | + $oldId = 'amazon::'.$params['key'].md5($params['secret']); |
|
| 188 | 188 | |
| 189 | 189 | // find by old id or bucket |
| 190 | 190 | $stmt = \OC::$server->getDatabaseConnection()->prepare( |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | try { |
| 237 | 237 | $this->getConnection()->putObject([ |
| 238 | 238 | 'Bucket' => $this->bucket, |
| 239 | - 'Key' => $path . '/', |
|
| 239 | + 'Key' => $path.'/', |
|
| 240 | 240 | 'Body' => '', |
| 241 | 241 | 'ContentType' => 'httpd/unix-directory' |
| 242 | 242 | ]); |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | 'Bucket' => $this->bucket |
| 288 | 288 | ]; |
| 289 | 289 | if ($path !== null) { |
| 290 | - $params['Prefix'] = $path . '/'; |
|
| 290 | + $params['Prefix'] = $path.'/'; |
|
| 291 | 291 | } |
| 292 | 292 | try { |
| 293 | 293 | $connection = $this->getConnection(); |
@@ -353,9 +353,9 @@ discard block |
||
| 353 | 353 | $files[] = $file; |
| 354 | 354 | |
| 355 | 355 | // store this information for later usage |
| 356 | - $this->filesCache[$path . $file] = [ |
|
| 356 | + $this->filesCache[$path.$file] = [ |
|
| 357 | 357 | 'ContentLength' => $object['Size'], |
| 358 | - 'LastModified' => (string)$object['LastModified'], |
|
| 358 | + 'LastModified' => (string) $object['LastModified'], |
|
| 359 | 359 | ]; |
| 360 | 360 | } |
| 361 | 361 | } |
@@ -406,12 +406,12 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | private function getContentLength($path) { |
| 408 | 408 | if (isset($this->filesCache[$path])) { |
| 409 | - return (int)$this->filesCache[$path]['ContentLength']; |
|
| 409 | + return (int) $this->filesCache[$path]['ContentLength']; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $result = $this->headObject($path); |
| 413 | 413 | if (isset($result['ContentLength'])) { |
| 414 | - return (int)$result['ContentLength']; |
|
| 414 | + return (int) $result['ContentLength']; |
|
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | return 0; |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $tmpFile = \OC::$server->getTempManager()->getTemporaryFile(); |
| 526 | 526 | |
| 527 | 527 | $handle = fopen($tmpFile, 'w'); |
| 528 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 528 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 529 | 529 | $this->writeBack($tmpFile, $path); |
| 530 | 530 | }); |
| 531 | 531 | case 'a': |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | $handle = fopen($tmpFile, $mode); |
| 553 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
| 553 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
| 554 | 554 | $this->writeBack($tmpFile, $path); |
| 555 | 555 | }); |
| 556 | 556 | } |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | $this->getConnection()->copyObject([ |
| 597 | 597 | 'Bucket' => $this->bucket, |
| 598 | 598 | 'Key' => $this->cleanKey($path2), |
| 599 | - 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1) |
|
| 599 | + 'CopySource' => S3Client::encodeKey($this->bucket.'/'.$path1) |
|
| 600 | 600 | ]); |
| 601 | 601 | $this->testTimeout(); |
| 602 | 602 | } catch (S3Exception $e) { |
@@ -609,8 +609,8 @@ discard block |
||
| 609 | 609 | try { |
| 610 | 610 | $this->getConnection()->copyObject([ |
| 611 | 611 | 'Bucket' => $this->bucket, |
| 612 | - 'Key' => $path2 . '/', |
|
| 613 | - 'CopySource' => S3Client::encodeKey($this->bucket . '/' . $path1 . '/') |
|
| 612 | + 'Key' => $path2.'/', |
|
| 613 | + 'CopySource' => S3Client::encodeKey($this->bucket.'/'.$path1.'/') |
|
| 614 | 614 | ]); |
| 615 | 615 | $this->testTimeout(); |
| 616 | 616 | } catch (S3Exception $e) { |
@@ -625,8 +625,8 @@ discard block |
||
| 625 | 625 | continue; |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | - $source = $path1 . '/' . $file; |
|
| 629 | - $target = $path2 . '/' . $file; |
|
| 628 | + $source = $path1.'/'.$file; |
|
| 629 | + $target = $path2.'/'.$file; |
|
| 630 | 630 | $this->copy($source, $target); |
| 631 | 631 | } |
| 632 | 632 | } |