@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | $this->realDataDir = $this->datadir; |
| 77 | 77 | } else { |
| 78 | 78 | $realPath = realpath($this->datadir) ?: $this->datadir; |
| 79 | - $this->realDataDir = rtrim($realPath, '/') . '/'; |
|
| 79 | + $this->realDataDir = rtrim($realPath, '/').'/'; |
|
| 80 | 80 | } |
| 81 | 81 | if (substr($this->datadir, -1) !== '/') { |
| 82 | 82 | $this->datadir .= '/'; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | public function getId() { |
| 93 | - return 'local::' . $this->datadir; |
|
| 93 | + return 'local::'.$this->datadir; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | public function mkdir($path) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | foreach ($iterator as $file) { |
| 310 | 310 | /** @var \SplFileInfo $file */ |
| 311 | 311 | if (Filesystem::isFileBlacklisted($file->getBasename())) { |
| 312 | - throw new ForbiddenException('Invalid path: ' . $file->getPathname(), false); |
|
| 312 | + throw new ForbiddenException('Invalid path: '.$file->getPathname(), false); |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | } |
@@ -319,17 +319,17 @@ discard block |
||
| 319 | 319 | $dstParent = dirname($path2); |
| 320 | 320 | |
| 321 | 321 | if (!$this->isUpdatable($srcParent)) { |
| 322 | - \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, ILogger::ERROR); |
|
| 322 | + \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : '.$srcParent, ILogger::ERROR); |
|
| 323 | 323 | return false; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | if (!$this->isUpdatable($dstParent)) { |
| 327 | - \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, ILogger::ERROR); |
|
| 327 | + \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : '.$dstParent, ILogger::ERROR); |
|
| 328 | 328 | return false; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | if (!$this->file_exists($path1)) { |
| 332 | - \OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, ILogger::ERROR); |
|
| 332 | + \OCP\Util::writeLog('core', 'unable to rename, file does not exists : '.$path1, ILogger::ERROR); |
|
| 333 | 333 | return false; |
| 334 | 334 | } |
| 335 | 335 | |
@@ -419,13 +419,13 @@ discard block |
||
| 419 | 419 | if (\OC\Files\Filesystem::isIgnoredDir($item)) { |
| 420 | 420 | continue; |
| 421 | 421 | } |
| 422 | - $physicalItem = $physicalDir . '/' . $item; |
|
| 422 | + $physicalItem = $physicalDir.'/'.$item; |
|
| 423 | 423 | |
| 424 | 424 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
| 425 | - $files[] = $dir . '/' . $item; |
|
| 425 | + $files[] = $dir.'/'.$item; |
|
| 426 | 426 | } |
| 427 | 427 | if (is_dir($physicalItem)) { |
| 428 | - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); |
|
| 428 | + $files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); |
|
| 429 | 429 | } |
| 430 | 430 | } |
| 431 | 431 | return $files; |
@@ -455,10 +455,10 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | public function getSourcePath($path) { |
| 457 | 457 | if (Filesystem::isFileBlacklisted($path)) { |
| 458 | - throw new ForbiddenException('Invalid path: ' . $path, false); |
|
| 458 | + throw new ForbiddenException('Invalid path: '.$path, false); |
|
| 459 | 459 | } |
| 460 | 460 | |
| 461 | - $fullPath = $this->datadir . $path; |
|
| 461 | + $fullPath = $this->datadir.$path; |
|
| 462 | 462 | $currentPath = $path; |
| 463 | 463 | $allowSymlinks = $this->config->getSystemValue('localstorage.allowsymlinks', false); |
| 464 | 464 | if ($allowSymlinks || $currentPath === '') { |
@@ -471,10 +471,10 @@ discard block |
||
| 471 | 471 | if ($currentPath === '' || $currentPath === '.') { |
| 472 | 472 | return $fullPath; |
| 473 | 473 | } |
| 474 | - $realPath = realpath($this->datadir . $currentPath); |
|
| 474 | + $realPath = realpath($this->datadir.$currentPath); |
|
| 475 | 475 | } |
| 476 | 476 | if ($realPath) { |
| 477 | - $realPath = $realPath . '/'; |
|
| 477 | + $realPath = $realPath.'/'; |
|
| 478 | 478 | } |
| 479 | 479 | if (substr($realPath, 0, $this->dataDirLength) === $this->realDataDir) { |
| 480 | 480 | return $fullPath; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $this->mkdir($path2); |
| 226 | 226 | while ($file = readdir($dir)) { |
| 227 | 227 | if (!Filesystem::isIgnoredDir($file)) { |
| 228 | - if (!$this->copy($path1 . '/' . $file, $path2 . '/' . $file)) { |
|
| 228 | + if (!$this->copy($path1.'/'.$file, $path2.'/'.$file)) { |
|
| 229 | 229 | return false; |
| 230 | 230 | } |
| 231 | 231 | } |
@@ -279,12 +279,12 @@ discard block |
||
| 279 | 279 | if (is_resource($dh)) { |
| 280 | 280 | while (($file = readdir($dh)) !== false) { |
| 281 | 281 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
| 282 | - if ($this->is_dir($path . '/' . $file)) { |
|
| 283 | - mkdir($target . '/' . $file); |
|
| 284 | - $this->addLocalFolder($path . '/' . $file, $target . '/' . $file); |
|
| 282 | + if ($this->is_dir($path.'/'.$file)) { |
|
| 283 | + mkdir($target.'/'.$file); |
|
| 284 | + $this->addLocalFolder($path.'/'.$file, $target.'/'.$file); |
|
| 285 | 285 | } else { |
| 286 | - $tmp = $this->toTmpFile($path . '/' . $file); |
|
| 287 | - rename($tmp, $target . '/' . $file); |
|
| 286 | + $tmp = $this->toTmpFile($path.'/'.$file); |
|
| 287 | + rename($tmp, $target.'/'.$file); |
|
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | } |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | continue; |
| 306 | 306 | } |
| 307 | 307 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
| 308 | - $files[] = $dir . '/' . $item; |
|
| 308 | + $files[] = $dir.'/'.$item; |
|
| 309 | 309 | } |
| 310 | - if ($this->is_dir($dir . '/' . $item)) { |
|
| 311 | - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); |
|
| 310 | + if ($this->is_dir($dir.'/'.$item)) { |
|
| 311 | + $files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); |
|
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | } |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | if (!isset($this->watcher)) { |
| 360 | 360 | $this->watcher = new Watcher($storage); |
| 361 | 361 | $globalPolicy = \OC::$server->getConfig()->getSystemValue('filesystem_check_changes', Watcher::CHECK_NEVER); |
| 362 | - $this->watcher->setPolicy((int)$this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
| 362 | + $this->watcher->setPolicy((int) $this->getMountOption('filesystem_check_changes', $globalPolicy)); |
|
| 363 | 363 | } |
| 364 | 364 | return $this->watcher; |
| 365 | 365 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | } |
| 377 | 377 | if (!isset($storage->propagator)) { |
| 378 | 378 | $config = \OC::$server->getSystemConfig(); |
| 379 | - $storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_' . $config->getValue('instanceid')]); |
|
| 379 | + $storage->propagator = new Propagator($storage, \OC::$server->getDatabaseConnection(), ['appdata_'.$config->getValue('instanceid')]); |
|
| 380 | 380 | } |
| 381 | 381 | return $storage->propagator; |
| 382 | 382 | } |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | */ |
| 435 | 435 | public function cleanPath($path) { |
| 436 | 436 | if (strlen($path) == 0 or $path[0] != '/') { |
| 437 | - $path = '/' . $path; |
|
| 437 | + $path = '/'.$path; |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | $output = []; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | \OC::$server->getLogger()->info("External storage not available: stat() failed"); |
| 463 | 463 | return false; |
| 464 | 464 | } catch (\Exception $e) { |
| 465 | - \OC::$server->getLogger()->warning("External storage not available: " . $e->getMessage()); |
|
| 465 | + \OC::$server->getLogger()->warning("External storage not available: ".$e->getMessage()); |
|
| 466 | 466 | \OC::$server->getLogger()->logException($e, ['level' => ILogger::WARN]); |
| 467 | 467 | return false; |
| 468 | 468 | } |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | $result = true; |
| 617 | 617 | while ($result and ($file = readdir($dh)) !== false) { |
| 618 | 618 | if (!Filesystem::isIgnoredDir($file)) { |
| 619 | - $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file); |
|
| 619 | + $result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath.'/'.$file, $targetInternalPath.'/'.$file); |
|
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | } |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $this->getCache()->remove($targetInternalPath); |
| 645 | 645 | } |
| 646 | 646 | } |
| 647 | - return (bool)$result; |
|
| 647 | + return (bool) $result; |
|
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | /** |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | */ |
| 705 | 705 | public function getMetaData($path) { |
| 706 | 706 | if (Filesystem::isFileBlacklisted($path)) { |
| 707 | - throw new ForbiddenException('Invalid path: ' . $path, false); |
|
| 707 | + throw new ForbiddenException('Invalid path: '.$path, false); |
|
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | $permissions = $this->getPermissions($path); |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | ); |
| 756 | 756 | } |
| 757 | 757 | try { |
| 758 | - $provider->acquireLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type, $this->getId() . '::' . $path); |
|
| 758 | + $provider->acquireLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type, $this->getId().'::'.$path); |
|
| 759 | 759 | } catch (LockedException $e) { |
| 760 | 760 | if ($logger) { |
| 761 | 761 | $logger->logException($e, ['level' => ILogger::INFO]); |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | ); |
| 788 | 788 | } |
| 789 | 789 | try { |
| 790 | - $provider->releaseLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
| 790 | + $provider->releaseLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
| 791 | 791 | } catch (LockedException $e) { |
| 792 | 792 | if ($logger) { |
| 793 | 793 | $logger->logException($e, ['level' => ILogger::INFO]); |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | ); |
| 820 | 820 | } |
| 821 | 821 | try { |
| 822 | - $provider->changeLock('files/' . md5($this->getId() . '::' . trim($path, '/')), $type); |
|
| 822 | + $provider->changeLock('files/'.md5($this->getId().'::'.trim($path, '/')), $type); |
|
| 823 | 823 | } catch (LockedException $e) { |
| 824 | 824 | \OC::$server->getLogger()->logException($e, ['level' => ILogger::INFO]); |
| 825 | 825 | throw $e; |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | $basePath = rtrim($directory, '/'); |
| 887 | 887 | while (($file = readdir($dh)) !== false) { |
| 888 | 888 | if (!Filesystem::isIgnoredDir($file)) { |
| 889 | - $childPath = $basePath . '/' . trim($file, '/'); |
|
| 889 | + $childPath = $basePath.'/'.trim($file, '/'); |
|
| 890 | 890 | $metadata = $this->getMetaData($childPath); |
| 891 | 891 | if ($metadata !== null) { |
| 892 | 892 | yield $metadata; |