@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | // Update the alternative mimetypes to avoid having to look them up each time. |
104 | 104 | foreach ($this->mimetypes as $mimeType) { |
105 | - $this->secureMimeTypes[$mimeType[0]] = isset($mimeType[1]) ? $mimeType[1]: $mimeType[0]; |
|
105 | + $this->secureMimeTypes[$mimeType[0]] = isset($mimeType[1]) ? $mimeType[1] : $mimeType[0]; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -114,10 +114,10 @@ discard block |
||
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | - $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypealiases.dist.json'), true); |
|
117 | + $this->mimeTypeAlias = json_decode(file_get_contents($this->defaultConfigDir.'/mimetypealiases.dist.json'), true); |
|
118 | 118 | |
119 | - if (file_exists($this->customConfigDir . '/mimetypealiases.json')) { |
|
120 | - $custom = json_decode(file_get_contents($this->customConfigDir . '/mimetypealiases.json'), true); |
|
119 | + if (file_exists($this->customConfigDir.'/mimetypealiases.json')) { |
|
120 | + $custom = json_decode(file_get_contents($this->customConfigDir.'/mimetypealiases.json'), true); |
|
121 | 121 | $this->mimeTypeAlias = array_merge($this->mimeTypeAlias, $custom); |
122 | 122 | } |
123 | 123 | } |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
141 | - $mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir . '/mimetypemapping.dist.json'), true); |
|
141 | + $mimetypeMapping = json_decode(file_get_contents($this->defaultConfigDir.'/mimetypemapping.dist.json'), true); |
|
142 | 142 | |
143 | 143 | //Check if need to load custom mappings |
144 | - if (file_exists($this->customConfigDir . '/mimetypemapping.json')) { |
|
145 | - $custom = json_decode(file_get_contents($this->customConfigDir . '/mimetypemapping.json'), true); |
|
144 | + if (file_exists($this->customConfigDir.'/mimetypemapping.json')) { |
|
145 | + $custom = json_decode(file_get_contents($this->customConfigDir.'/mimetypemapping.json'), true); |
|
146 | 146 | $mimetypeMapping = array_merge($mimetypeMapping, $custom); |
147 | 147 | } |
148 | 148 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | // Icon exists? |
308 | 308 | try { |
309 | - $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $icon . '.svg'); |
|
309 | + $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/'.$icon.'.svg'); |
|
310 | 310 | return $this->mimetypeIcons[$mimetype]; |
311 | 311 | } catch (\RuntimeException $e) { |
312 | 312 | // Specified image not found |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | // Try only the first part of the filetype |
316 | 316 | $mimePart = substr($icon, 0, strpos($icon, '-')); |
317 | 317 | try { |
318 | - $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/' . $mimePart . '.svg'); |
|
318 | + $this->mimetypeIcons[$mimetype] = $this->urlGenerator->imagePath('core', 'filetypes/'.$mimePart.'.svg'); |
|
319 | 319 | return $this->mimetypeIcons[$mimetype]; |
320 | 320 | } catch (\RuntimeException $e) { |
321 | 321 | // Image for the first part of the mimetype not found |
@@ -26,7 +26,7 @@ |
||
26 | 26 | use OCP\Files\NotPermittedException; |
27 | 27 | use OCP\Files\SimpleFS\ISimpleFile; |
28 | 28 | |
29 | -class SimpleFile implements ISimpleFile { |
|
29 | +class SimpleFile implements ISimpleFile { |
|
30 | 30 | |
31 | 31 | /** @var File $file */ |
32 | 32 | private $file; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | use OCP\Files\NotFoundException; |
29 | 29 | use OCP\Files\SimpleFS\ISimpleFolder; |
30 | 30 | |
31 | -class SimpleFolder implements ISimpleFolder { |
|
31 | +class SimpleFolder implements ISimpleFolder { |
|
32 | 32 | |
33 | 33 | /** @var Folder */ |
34 | 34 | private $folder; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // no point in continuing if the section was not found, use original path |
81 | 81 | return $fullPath; |
82 | 82 | } |
83 | - $path = $convertedPath . '/'; |
|
83 | + $path = $convertedPath.'/'; |
|
84 | 84 | } |
85 | 85 | $path = rtrim($path, '/'); |
86 | 86 | return $path; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return string|null original or converted path, or null if none of the forms was found |
97 | 97 | */ |
98 | 98 | private function findPathToUseLastSection($basePath, $lastSection) { |
99 | - $fullPath = $basePath . $lastSection; |
|
99 | + $fullPath = $basePath.$lastSection; |
|
100 | 100 | if ($lastSection === '' || $this->isAscii($lastSection) || $this->storage->file_exists($fullPath)) { |
101 | 101 | $this->namesCache[$fullPath] = $fullPath; |
102 | 102 | return $fullPath; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } else { |
109 | 109 | $otherFormPath = \Normalizer::normalize($lastSection, \Normalizer::FORM_C); |
110 | 110 | } |
111 | - $otherFullPath = $basePath . $otherFormPath; |
|
111 | + $otherFullPath = $basePath.$otherFormPath; |
|
112 | 112 | if ($this->storage->file_exists($otherFullPath)) { |
113 | 113 | $this->namesCache[$fullPath] = $otherFullPath; |
114 | 114 | return $otherFullPath; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | /** |
29 | 29 | * local storage backend in temporary folder for testing purpose |
30 | 30 | */ |
31 | -class Temporary extends Local{ |
|
31 | +class Temporary extends Local { |
|
32 | 32 | public function __construct($arguments = null) { |
33 | 33 | parent::__construct(array('datadir' => \OC::$server->getTempManager()->getTemporaryFolder())); |
34 | 34 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->mkdir($path2); |
217 | 217 | while ($file = readdir($dir)) { |
218 | 218 | if (!Filesystem::isIgnoredDir($file)) { |
219 | - if (!$this->copy($path1 . '/' . $file, $path2 . '/' . $file)) { |
|
219 | + if (!$this->copy($path1.'/'.$file, $path2.'/'.$file)) { |
|
220 | 220 | return false; |
221 | 221 | } |
222 | 222 | } |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | if (is_resource($dh)) { |
268 | 268 | while (($file = readdir($dh)) !== false) { |
269 | 269 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
270 | - if ($this->is_dir($path . '/' . $file)) { |
|
271 | - mkdir($target . '/' . $file); |
|
272 | - $this->addLocalFolder($path . '/' . $file, $target . '/' . $file); |
|
270 | + if ($this->is_dir($path.'/'.$file)) { |
|
271 | + mkdir($target.'/'.$file); |
|
272 | + $this->addLocalFolder($path.'/'.$file, $target.'/'.$file); |
|
273 | 273 | } else { |
274 | - $tmp = $this->toTmpFile($path . '/' . $file); |
|
275 | - rename($tmp, $target . '/' . $file); |
|
274 | + $tmp = $this->toTmpFile($path.'/'.$file); |
|
275 | + rename($tmp, $target.'/'.$file); |
|
276 | 276 | } |
277 | 277 | } |
278 | 278 | } |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | while (($item = readdir($dh)) !== false) { |
292 | 292 | if (\OC\Files\Filesystem::isIgnoredDir($item)) continue; |
293 | 293 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
294 | - $files[] = $dir . '/' . $item; |
|
294 | + $files[] = $dir.'/'.$item; |
|
295 | 295 | } |
296 | - if ($this->is_dir($dir . '/' . $item)) { |
|
297 | - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); |
|
296 | + if ($this->is_dir($dir.'/'.$item)) { |
|
297 | + $files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); |
|
298 | 298 | } |
299 | 299 | } |
300 | 300 | } |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | if (!isset($this->watcher)) { |
346 | 346 | $this->watcher = new Watcher($storage); |
347 | 347 | $globalPolicy = \OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_NEVER); |
348 | - $this->watcher->setPolicy((int)$this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
348 | + $this->watcher->setPolicy((int) $this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
349 | 349 | } |
350 | 350 | return $this->watcher; |
351 | 351 | } |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | */ |
420 | 420 | public function cleanPath($path) { |
421 | 421 | if (strlen($path) == 0 or $path[0] != '/') { |
422 | - $path = '/' . $path; |
|
422 | + $path = '/'.$path; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | $output = array(); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | if (is_resource($dh)) { |
596 | 596 | while ($result and ($file = readdir($dh)) !== false) { |
597 | 597 | if (!Filesystem::isIgnoredDir($file)) { |
598 | - $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file); |
|
598 | + $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath.'/'.$file, $targetInternalPath.'/'.$file); |
|
599 | 599 | } |
600 | 600 | } |
601 | 601 | } |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | $this->getCache()->remove($targetInternalPath); |
622 | 622 | } |
623 | 623 | } |
624 | - return (bool)$result; |
|
624 | + return (bool) $result; |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | /** |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | ); |
702 | 702 | } |
703 | 703 | try { |
704 | - $provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
704 | + $provider->acquireLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
705 | 705 | } catch (LockedException $e) { |
706 | 706 | if ($logger) { |
707 | 707 | $logger->logException($e); |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | ); |
734 | 734 | } |
735 | 735 | try { |
736 | - $provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
736 | + $provider->releaseLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
737 | 737 | } catch (LockedException $e) { |
738 | 738 | if ($logger) { |
739 | 739 | $logger->logException($e); |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | ); |
766 | 766 | } |
767 | 767 | try { |
768 | - $provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
768 | + $provider->changeLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
769 | 769 | } catch (LockedException $e) { |
770 | 770 | if ($logger) { |
771 | 771 | $logger->logException($e); |
@@ -90,11 +90,11 @@ |
||
90 | 90 | */ |
91 | 91 | public function wrap(IMountPoint $mountPoint, $storage) { |
92 | 92 | $wrappers = array_values($this->storageWrappers); |
93 | - usort($wrappers, function ($a, $b) { |
|
93 | + usort($wrappers, function($a, $b) { |
|
94 | 94 | return $b['priority'] - $a['priority']; |
95 | 95 | }); |
96 | 96 | /** @var callable[] $wrappers */ |
97 | - $wrappers = array_map(function ($wrapper) { |
|
97 | + $wrappers = array_map(function($wrapper) { |
|
98 | 98 | return $wrapper['wrapper']; |
99 | 99 | }, $wrappers); |
100 | 100 | foreach ($wrappers as $wrapper) { |
@@ -89,11 +89,11 @@ |
||
89 | 89 | $result = true; |
90 | 90 | while ($file = readdir($dh)) { |
91 | 91 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
92 | - if ($this->is_dir($source . '/' . $file)) { |
|
93 | - $this->mkdir($target . '/' . $file); |
|
94 | - $result = $this->copyRecursive($source . '/' . $file, $target . '/' . $file); |
|
92 | + if ($this->is_dir($source.'/'.$file)) { |
|
93 | + $this->mkdir($target.'/'.$file); |
|
94 | + $result = $this->copyRecursive($source.'/'.$file, $target.'/'.$file); |
|
95 | 95 | } else { |
96 | - $result = parent::copy($source . '/' . $file, $target . '/' . $file); |
|
96 | + $result = parent::copy($source.'/'.$file, $target.'/'.$file); |
|
97 | 97 | } |
98 | 98 | if (!$result) { |
99 | 99 | break; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | protected function buildPath($path) { |
59 | - $fullPath = \OC\Files\Filesystem::normalizePath($this->root . '/' . $path); |
|
59 | + $fullPath = \OC\Files\Filesystem::normalizePath($this->root.'/'.$path); |
|
60 | 60 | return ltrim($fullPath, '/'); |
61 | 61 | } |
62 | 62 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } catch (FileNotFoundException $e) { |
164 | 164 | return false; |
165 | 165 | } |
166 | - $names = array_map(function ($object) { |
|
166 | + $names = array_map(function($object) { |
|
167 | 167 | return $object['basename']; |
168 | 168 | }, $content); |
169 | 169 | return IteratorDirectory::wrap($names); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $tmpFile = \OCP\Files::tmpFile(); |
210 | 210 | } |
211 | 211 | $source = fopen($tmpFile, $mode); |
212 | - return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) { |
|
212 | + return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath) { |
|
213 | 213 | $this->flysystem->putStream($fullPath, fopen($tmpFile, 'r')); |
214 | 214 | unlink($tmpFile); |
215 | 215 | }); |