@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | throw new \Exception("API Key or password, Username, Bucket and Region have to be configured."); |
164 | 164 | } |
165 | 165 | |
166 | - $this->id = 'swift::' . $params['user'] . md5($params['bucket']); |
|
166 | + $this->id = 'swift::'.$params['user'].md5($params['bucket']); |
|
167 | 167 | |
168 | 168 | $bucketUrl = Url::factory($params['bucket']); |
169 | 169 | if ($bucketUrl->isAbsolute()) { |
@@ -236,16 +236,16 @@ discard block |
||
236 | 236 | continue; |
237 | 237 | } |
238 | 238 | |
239 | - if ($this->is_dir($path . '/' . $file)) { |
|
240 | - $this->rmdir($path . '/' . $file); |
|
239 | + if ($this->is_dir($path.'/'.$file)) { |
|
240 | + $this->rmdir($path.'/'.$file); |
|
241 | 241 | } else { |
242 | - $this->unlink($path . '/' . $file); |
|
242 | + $this->unlink($path.'/'.$file); |
|
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
246 | 246 | try { |
247 | - $this->getContainer()->dataObject()->setName($path . '/')->delete(); |
|
248 | - $this->objectCache->remove($path . '/'); |
|
247 | + $this->getContainer()->dataObject()->setName($path.'/')->delete(); |
|
248 | + $this->objectCache->remove($path.'/'); |
|
249 | 249 | } catch (Exceptions\DeleteError $e) { |
250 | 250 | \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); |
251 | 251 | return false; |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | $stat = array(); |
329 | - $stat['size'] = (int)$object->getContentLength(); |
|
329 | + $stat['size'] = (int) $object->getContentLength(); |
|
330 | 330 | $stat['mtime'] = $mtime; |
331 | 331 | $stat['atime'] = time(); |
332 | 332 | return $stat; |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | try { |
359 | 359 | $this->getContainer()->dataObject()->setName($path)->delete(); |
360 | 360 | $this->objectCache->remove($path); |
361 | - $this->objectCache->remove($path . '/'); |
|
361 | + $this->objectCache->remove($path.'/'); |
|
362 | 362 | } catch (ClientErrorResponseException $e) { |
363 | 363 | if ($e->getResponse()->getStatusCode() !== 404) { |
364 | 364 | \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); |
@@ -387,8 +387,8 @@ discard block |
||
387 | 387 | $streamInterface = $streamFactory->fromRequest($client->get($c->getUrl($path))); |
388 | 388 | $streamInterface->rewind(); |
389 | 389 | $stream = $streamInterface->getStream(); |
390 | - stream_context_set_option($stream, 'swift','content', $streamInterface); |
|
391 | - if(!strrpos($streamInterface |
|
390 | + stream_context_set_option($stream, 'swift', 'content', $streamInterface); |
|
391 | + if (!strrpos($streamInterface |
|
392 | 392 | ->getMetaData('wrapper_data')[0], '404 Not Found')) { |
393 | 393 | return $stream; |
394 | 394 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | file_put_contents($tmpFile, $source); |
423 | 423 | } |
424 | 424 | $handle = fopen($tmpFile, $mode); |
425 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
425 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
426 | 426 | $this->writeBack($tmpFile, $path); |
427 | 427 | }); |
428 | 428 | } |
@@ -469,10 +469,10 @@ discard block |
||
469 | 469 | |
470 | 470 | try { |
471 | 471 | $source = $this->fetchObject($path1); |
472 | - $source->copy($this->bucket . '/' . $path2); |
|
472 | + $source->copy($this->bucket.'/'.$path2); |
|
473 | 473 | // invalidate target object to force repopulation on fetch |
474 | 474 | $this->objectCache->remove($path2); |
475 | - $this->objectCache->remove($path2 . '/'); |
|
475 | + $this->objectCache->remove($path2.'/'); |
|
476 | 476 | } catch (ClientErrorResponseException $e) { |
477 | 477 | \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); |
478 | 478 | return false; |
@@ -484,11 +484,11 @@ discard block |
||
484 | 484 | $this->unlink($path2); |
485 | 485 | |
486 | 486 | try { |
487 | - $source = $this->fetchObject($path1 . '/'); |
|
488 | - $source->copy($this->bucket . '/' . $path2 . '/'); |
|
487 | + $source = $this->fetchObject($path1.'/'); |
|
488 | + $source->copy($this->bucket.'/'.$path2.'/'); |
|
489 | 489 | // invalidate target object to force repopulation on fetch |
490 | 490 | $this->objectCache->remove($path2); |
491 | - $this->objectCache->remove($path2 . '/'); |
|
491 | + $this->objectCache->remove($path2.'/'); |
|
492 | 492 | } catch (ClientErrorResponseException $e) { |
493 | 493 | \OCP\Util::writeLog('files_external', $e->getMessage(), \OCP\Util::ERROR); |
494 | 494 | return false; |
@@ -500,8 +500,8 @@ discard block |
||
500 | 500 | continue; |
501 | 501 | } |
502 | 502 | |
503 | - $source = $path1 . '/' . $file; |
|
504 | - $target = $path2 . '/' . $file; |
|
503 | + $source = $path1.'/'.$file; |
|
504 | + $target = $path2.'/'.$file; |
|
505 | 505 | $this->copy($source, $target); |
506 | 506 | } |
507 | 507 | |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | $path = ''; |
636 | 636 | } |
637 | 637 | $cachedContent = $this->getCache()->getFolderContents($path); |
638 | - $cachedNames = array_map(function ($content) { |
|
638 | + $cachedNames = array_map(function($content) { |
|
639 | 639 | return $content['name']; |
640 | 640 | }, $cachedContent); |
641 | 641 | sort($cachedNames); |