@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | $user = $params['user']; |
167 | - $this->id = 'swift::' . $user . md5($params['bucket']); |
|
167 | + $this->id = 'swift::'.$user.md5($params['bucket']); |
|
168 | 168 | |
169 | 169 | $bucketUrl = new Uri($params['bucket']); |
170 | 170 | if ($bucketUrl->getHost()) { |
171 | 171 | $params['bucket'] = basename($bucketUrl->getPath()); |
172 | - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
172 | + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | if (empty($params['url'])) { |
@@ -258,16 +258,16 @@ discard block |
||
258 | 258 | continue; |
259 | 259 | } |
260 | 260 | |
261 | - if ($this->is_dir($path . '/' . $file)) { |
|
262 | - $this->rmdir($path . '/' . $file); |
|
261 | + if ($this->is_dir($path.'/'.$file)) { |
|
262 | + $this->rmdir($path.'/'.$file); |
|
263 | 263 | } else { |
264 | - $this->unlink($path . '/' . $file); |
|
264 | + $this->unlink($path.'/'.$file); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | 268 | try { |
269 | - $this->objectStore->deleteObject($path . '/'); |
|
270 | - $this->objectCache->remove($path . '/'); |
|
269 | + $this->objectStore->deleteObject($path.'/'); |
|
270 | + $this->objectCache->remove($path.'/'); |
|
271 | 271 | } catch (BadResponseError $e) { |
272 | 272 | \OC::$server->getLogger()->logException($e, [ |
273 | 273 | 'level' => ILogger::ERROR, |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | $stat = array(); |
353 | - $stat['size'] = (int)$object->contentLength; |
|
353 | + $stat['size'] = (int) $object->contentLength; |
|
354 | 354 | $stat['mtime'] = $mtime; |
355 | 355 | $stat['atime'] = time(); |
356 | 356 | return $stat; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | try { |
383 | 383 | $this->objectStore->deleteObject($path); |
384 | 384 | $this->objectCache->remove($path); |
385 | - $this->objectCache->remove($path . '/'); |
|
385 | + $this->objectCache->remove($path.'/'); |
|
386 | 386 | } catch (BadResponseError $e) { |
387 | 387 | if ($e->getResponse()->getStatusCode() !== 404) { |
388 | 388 | \OC::$server->getLogger()->logException($e, [ |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | file_put_contents($tmpFile, $source); |
441 | 441 | } |
442 | 442 | $handle = fopen($tmpFile, $mode); |
443 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
443 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
444 | 444 | $this->writeBack($tmpFile, $path); |
445 | 445 | }); |
446 | 446 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | if (is_null($mtime)) { |
452 | 452 | $mtime = time(); |
453 | 453 | } |
454 | - $metadata = ['timestamp' => (string)$mtime]; |
|
454 | + $metadata = ['timestamp' => (string) $mtime]; |
|
455 | 455 | if ($this->file_exists($path)) { |
456 | 456 | if ($this->is_dir($path) && $path !== '.') { |
457 | 457 | $path .= '/'; |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | try { |
491 | 491 | $source = $this->fetchObject($path1); |
492 | 492 | $source->copy([ |
493 | - 'destination' => $this->bucket . '/' . $path2 |
|
493 | + 'destination' => $this->bucket.'/'.$path2 |
|
494 | 494 | ]); |
495 | 495 | // invalidate target object to force repopulation on fetch |
496 | 496 | $this->objectCache->remove($path2); |
497 | - $this->objectCache->remove($path2 . '/'); |
|
497 | + $this->objectCache->remove($path2.'/'); |
|
498 | 498 | } catch (BadResponseError $e) { |
499 | 499 | \OC::$server->getLogger()->logException($e, [ |
500 | 500 | 'level' => ILogger::ERROR, |
@@ -505,13 +505,13 @@ discard block |
||
505 | 505 | |
506 | 506 | } else if ($fileType === 'dir') { |
507 | 507 | try { |
508 | - $source = $this->fetchObject($path1 . '/'); |
|
508 | + $source = $this->fetchObject($path1.'/'); |
|
509 | 509 | $source->copy([ |
510 | - 'destination' => $this->bucket . '/' . $path2 . '/' |
|
510 | + 'destination' => $this->bucket.'/'.$path2.'/' |
|
511 | 511 | ]); |
512 | 512 | // invalidate target object to force repopulation on fetch |
513 | 513 | $this->objectCache->remove($path2); |
514 | - $this->objectCache->remove($path2 . '/'); |
|
514 | + $this->objectCache->remove($path2.'/'); |
|
515 | 515 | } catch (BadResponseError $e) { |
516 | 516 | \OC::$server->getLogger()->logException($e, [ |
517 | 517 | 'level' => ILogger::ERROR, |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | continue; |
527 | 527 | } |
528 | 528 | |
529 | - $source = $path1 . '/' . $file; |
|
530 | - $target = $path2 . '/' . $file; |
|
529 | + $source = $path1.'/'.$file; |
|
530 | + $target = $path2.'/'.$file; |
|
531 | 531 | $this->copy($source, $target); |
532 | 532 | } |
533 | 533 | |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | $path = ''; |
609 | 609 | } |
610 | 610 | $cachedContent = $this->getCache()->getFolderContents($path); |
611 | - $cachedNames = array_map(function ($content) { |
|
611 | + $cachedNames = array_map(function($content) { |
|
612 | 612 | return $content['name']; |
613 | 613 | }, $cachedContent); |
614 | 614 | sort($cachedNames); |