@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2016, ownCloud, Inc. |
5 | 5 | * |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | $this->configured = true; |
77 | 77 | |
78 | - $this->stack->push(Middleware::mapRequest(function (RequestInterface $request) { |
|
78 | + $this->stack->push(Middleware::mapRequest(function(RequestInterface $request) { |
|
79 | 79 | return $request |
80 | 80 | ->withHeader('User-Agent', 'Nextcloud Server Crawler'); |
81 | 81 | })); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if ($this->config->getSystemValue('installed', false)) { |
102 | 102 | return $this->certificateManager->getAbsoluteBundlePath(null); |
103 | 103 | } else { |
104 | - return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; |
|
104 | + return \OC::$SERVERROOT.'/resources/config/ca-bundle.crt'; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $proxyUri = ''; |
118 | 118 | |
119 | 119 | if ($proxyUserPwd !== null) { |
120 | - $proxyUri .= $proxyUserPwd . '@'; |
|
120 | + $proxyUri .= $proxyUserPwd.'@'; |
|
121 | 121 | } |
122 | 122 | if ($proxyHost !== null) { |
123 | 123 | $proxyUri .= $proxyHost; |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018 Robin Appelman <[email protected]> |
5 | 5 | * |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | private function getCachedToken(string $cacheKey) { |
54 | - $cachedTokenString = $this->cache->get($cacheKey . '/token'); |
|
54 | + $cachedTokenString = $this->cache->get($cacheKey.'/token'); |
|
55 | 55 | if ($cachedTokenString) { |
56 | 56 | return json_decode($cachedTokenString); |
57 | 57 | } else { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | private function cacheToken(Token $token, string $cacheKey) { |
63 | - $this->cache->set($cacheKey . '/token', json_encode($token)); |
|
63 | + $this->cache->set($cacheKey.'/token', json_encode($token)); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->params['tenantName'] = $this->params['tenant']; |
91 | 91 | } |
92 | 92 | |
93 | - $cacheKey = $userName . '@' . $this->params['url'] . '/' . $this->params['bucket']; |
|
93 | + $cacheKey = $userName.'@'.$this->params['url'].'/'.$this->params['bucket']; |
|
94 | 94 | $token = $this->getCachedToken($cacheKey); |
95 | 95 | $hasToken = is_array($token) && (new \DateTimeImmutable($token['expires_at'])) > (new \DateTimeImmutable('now')); |
96 | 96 | if ($hasToken) { |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } catch (ConnectException $e) { |
187 | 187 | /** @var RequestInterface $request */ |
188 | 188 | $request = $e->getRequest(); |
189 | - $host = $request->getUri()->getHost() . ':' . $request->getUri()->getPort(); |
|
189 | + $host = $request->getUri()->getHost().':'.$request->getUri()->getPort(); |
|
190 | 190 | \OC::$server->getLogger()->error("Can't connect to object storage server at $host"); |
191 | 191 | throw new StorageNotAvailableException("Can't connect to object storage server at $host", StorageNotAvailableException::STATUS_ERROR, $e); |
192 | 192 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2016, ownCloud, Inc. |
5 | 5 | * |
@@ -163,12 +163,12 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | $user = isset($params['user']) ? $params['user'] : $params['userid']; |
166 | - $this->id = 'swift::' . $user . md5($params['bucket']); |
|
166 | + $this->id = 'swift::'.$user.md5($params['bucket']); |
|
167 | 167 | |
168 | 168 | $bucketUrl = new Uri($params['bucket']); |
169 | 169 | if ($bucketUrl->getHost()) { |
170 | 170 | $params['bucket'] = basename($bucketUrl->getPath()); |
171 | - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
171 | + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | if (empty($params['url'])) { |
@@ -250,16 +250,16 @@ discard block |
||
250 | 250 | continue; |
251 | 251 | } |
252 | 252 | |
253 | - if ($this->is_dir($path . '/' . $file)) { |
|
254 | - $this->rmdir($path . '/' . $file); |
|
253 | + if ($this->is_dir($path.'/'.$file)) { |
|
254 | + $this->rmdir($path.'/'.$file); |
|
255 | 255 | } else { |
256 | - $this->unlink($path . '/' . $file); |
|
256 | + $this->unlink($path.'/'.$file); |
|
257 | 257 | } |
258 | 258 | } |
259 | 259 | |
260 | 260 | try { |
261 | - $this->objectStore->deleteObject($path . '/'); |
|
262 | - $this->objectCache->remove($path . '/'); |
|
261 | + $this->objectStore->deleteObject($path.'/'); |
|
262 | + $this->objectCache->remove($path.'/'); |
|
263 | 263 | } catch (BadResponseError $e) { |
264 | 264 | \OC::$server->getLogger()->logException($e, [ |
265 | 265 | 'level' => \OCP\Util::ERROR, |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | } |
343 | 343 | |
344 | 344 | $stat = array(); |
345 | - $stat['size'] = (int)$object->contentLength; |
|
345 | + $stat['size'] = (int) $object->contentLength; |
|
346 | 346 | $stat['mtime'] = $mtime; |
347 | 347 | $stat['atime'] = time(); |
348 | 348 | return $stat; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | try { |
375 | 375 | $this->objectStore->deleteObject($path); |
376 | 376 | $this->objectCache->remove($path); |
377 | - $this->objectCache->remove($path . '/'); |
|
377 | + $this->objectCache->remove($path.'/'); |
|
378 | 378 | } catch (BadResponseError $e) { |
379 | 379 | if ($e->getResponse()->getStatusCode() !== 404) { |
380 | 380 | \OC::$server->getLogger()->logException($e, [ |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | file_put_contents($tmpFile, $source); |
433 | 433 | } |
434 | 434 | $handle = fopen($tmpFile, $mode); |
435 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
435 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
436 | 436 | $this->writeBack($tmpFile, $path); |
437 | 437 | }); |
438 | 438 | } |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | try { |
483 | 483 | $source = $this->fetchObject($path1); |
484 | 484 | $source->copy([ |
485 | - 'destination' => $this->bucket . '/' . $path2 |
|
485 | + 'destination' => $this->bucket.'/'.$path2 |
|
486 | 486 | ]); |
487 | 487 | // invalidate target object to force repopulation on fetch |
488 | 488 | $this->objectCache->remove($path2); |
489 | - $this->objectCache->remove($path2 . '/'); |
|
489 | + $this->objectCache->remove($path2.'/'); |
|
490 | 490 | } catch (BadResponseError $e) { |
491 | 491 | \OC::$server->getLogger()->logException($e, [ |
492 | 492 | 'level' => \OCP\Util::ERROR, |
@@ -497,13 +497,13 @@ discard block |
||
497 | 497 | |
498 | 498 | } else if ($fileType === 'dir') { |
499 | 499 | try { |
500 | - $source = $this->fetchObject($path1 . '/'); |
|
500 | + $source = $this->fetchObject($path1.'/'); |
|
501 | 501 | $source->copy([ |
502 | - 'destination' => $this->bucket . '/' . $path2 . '/' |
|
502 | + 'destination' => $this->bucket.'/'.$path2.'/' |
|
503 | 503 | ]); |
504 | 504 | // invalidate target object to force repopulation on fetch |
505 | 505 | $this->objectCache->remove($path2); |
506 | - $this->objectCache->remove($path2 . '/'); |
|
506 | + $this->objectCache->remove($path2.'/'); |
|
507 | 507 | } catch (BadResponseError $e) { |
508 | 508 | \OC::$server->getLogger()->logException($e, [ |
509 | 509 | 'level' => \OCP\Util::ERROR, |
@@ -518,8 +518,8 @@ discard block |
||
518 | 518 | continue; |
519 | 519 | } |
520 | 520 | |
521 | - $source = $path1 . '/' . $file; |
|
522 | - $target = $path2 . '/' . $file; |
|
521 | + $source = $path1.'/'.$file; |
|
522 | + $target = $path2.'/'.$file; |
|
523 | 523 | $this->copy($source, $target); |
524 | 524 | } |
525 | 525 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | $path = ''; |
601 | 601 | } |
602 | 602 | $cachedContent = $this->getCache()->getFolderContents($path); |
603 | - $cachedNames = array_map(function ($content) { |
|
603 | + $cachedNames = array_map(function($content) { |
|
604 | 604 | return $content['name']; |
605 | 605 | }, $cachedContent); |
606 | 606 | sort($cachedNames); |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types=1); |
|
2 | +declare(strict_types = 1); |
|
3 | 3 | /** |
4 | 4 | * @copyright Copyright (c) 2018 Robin Appelman <[email protected]> |
5 | 5 | * |