@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if (!$this->isValidPath($path)) { |
| 57 | 57 | throw new NotPermittedException('Invalid path'); |
| 58 | 58 | } |
| 59 | - return $this->path . $this->normalizePath($path); |
|
| 59 | + return $this->path.$this->normalizePath($path); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /** |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | if ($path === $this->path) { |
| 71 | 71 | return '/'; |
| 72 | - } else if (strpos($path, $this->path . '/') !== 0) { |
|
| 72 | + } else if (strpos($path, $this->path.'/') !== 0) { |
|
| 73 | 73 | return null; |
| 74 | 74 | } else { |
| 75 | 75 | $path = substr($path, strlen($this->path)); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @return bool |
| 85 | 85 | */ |
| 86 | 86 | public function isSubNode($node) { |
| 87 | - return strpos($node->getPath(), $this->path . '/') === 0; |
|
| 87 | + return strpos($node->getPath(), $this->path.'/') === 0; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | public function getDirectoryListing() { |
| 97 | 97 | $folderContent = $this->view->getDirectoryContent($this->path); |
| 98 | 98 | |
| 99 | - return array_map(function (FileInfo $info) { |
|
| 99 | + return array_map(function(FileInfo $info) { |
|
| 100 | 100 | if ($info->getMimetype() === 'httpd/unix-directory') { |
| 101 | 101 | return new Folder($this->root, $this->view, $info->getPath(), $info); |
| 102 | 102 | } else { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $nonExisting = new NonExistingFolder($this->root, $this->view, $fullPath); |
| 159 | 159 | $this->root->emit('\OC\Files', 'preWrite', array($nonExisting)); |
| 160 | 160 | $this->root->emit('\OC\Files', 'preCreate', array($nonExisting)); |
| 161 | - if(!$this->view->mkdir($fullPath)) { |
|
| 161 | + if (!$this->view->mkdir($fullPath)) { |
|
| 162 | 162 | throw new NotPermittedException('Could not create folder'); |
| 163 | 163 | } |
| 164 | 164 | $node = new Folder($this->root, $this->view, $fullPath); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function search($query) { |
| 202 | 202 | if (is_string($query)) { |
| 203 | - return $this->searchCommon('search', array('%' . $query . '%')); |
|
| 203 | + return $this->searchCommon('search', array('%'.$query.'%')); |
|
| 204 | 204 | } else { |
| 205 | 205 | return $this->searchCommon('searchQuery', array($query)); |
| 206 | 206 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $internalPath = $mount->getInternalPath($this->path); |
| 241 | 241 | $internalPath = rtrim($internalPath, '/'); |
| 242 | 242 | if ($internalPath !== '') { |
| 243 | - $internalPath = $internalPath . '/'; |
|
| 243 | + $internalPath = $internalPath.'/'; |
|
| 244 | 244 | } |
| 245 | 245 | $internalRootLength = strlen($internalPath); |
| 246 | 246 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $result['internalPath'] = $result['path']; |
| 253 | 253 | $result['path'] = substr($result['path'], $internalRootLength); |
| 254 | 254 | $result['storage'] = $storage; |
| 255 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 255 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | |
@@ -266,14 +266,14 @@ discard block |
||
| 266 | 266 | $results = call_user_func_array(array($cache, $method), $args); |
| 267 | 267 | foreach ($results as $result) { |
| 268 | 268 | $result['internalPath'] = $result['path']; |
| 269 | - $result['path'] = $relativeMountPoint . $result['path']; |
|
| 269 | + $result['path'] = $relativeMountPoint.$result['path']; |
|
| 270 | 270 | $result['storage'] = $storage; |
| 271 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 271 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 272 | 272 | } |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - return array_map(function (FileInfo $file) { |
|
| 276 | + return array_map(function(FileInfo $file) { |
|
| 277 | 277 | return $this->createNode($file->getPath(), $file); |
| 278 | 278 | }, $files); |
| 279 | 279 | } |
@@ -289,16 +289,16 @@ discard block |
||
| 289 | 289 | } else { |
| 290 | 290 | $user = null; |
| 291 | 291 | } |
| 292 | - $mountsContainingFile = $mountCache->getMountsForFileId((int)$id, $user); |
|
| 292 | + $mountsContainingFile = $mountCache->getMountsForFileId((int) $id, $user); |
|
| 293 | 293 | $mounts = $this->root->getMountsIn($this->path); |
| 294 | 294 | $mounts[] = $this->root->getMount($this->path); |
| 295 | 295 | /** @var IMountPoint[] $folderMounts */ |
| 296 | - $folderMounts = array_combine(array_map(function (IMountPoint $mountPoint) { |
|
| 296 | + $folderMounts = array_combine(array_map(function(IMountPoint $mountPoint) { |
|
| 297 | 297 | return $mountPoint->getMountPoint(); |
| 298 | 298 | }, $mounts), $mounts); |
| 299 | 299 | |
| 300 | 300 | /** @var ICachedMountInfo[] $mountsContainingFile */ |
| 301 | - $mountsContainingFile = array_values(array_filter($mountsContainingFile, function (ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 301 | + $mountsContainingFile = array_values(array_filter($mountsContainingFile, function(ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 302 | 302 | return isset($folderMounts[$cachedMountInfo->getMountPoint()]); |
| 303 | 303 | })); |
| 304 | 304 | |
@@ -306,18 +306,18 @@ discard block |
||
| 306 | 306 | return []; |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | - $nodes = array_map(function (ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
| 309 | + $nodes = array_map(function(ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
| 310 | 310 | $mount = $folderMounts[$cachedMountInfo->getMountPoint()]; |
| 311 | - $cacheEntry = $mount->getStorage()->getCache()->get((int)$id); |
|
| 311 | + $cacheEntry = $mount->getStorage()->getCache()->get((int) $id); |
|
| 312 | 312 | if (!$cacheEntry) { |
| 313 | 313 | return null; |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | // cache jails will hide the "true" internal path |
| 317 | - $internalPath = ltrim($cachedMountInfo->getRootInternalPath() . '/' . $cacheEntry->getPath(), '/'); |
|
| 317 | + $internalPath = ltrim($cachedMountInfo->getRootInternalPath().'/'.$cacheEntry->getPath(), '/'); |
|
| 318 | 318 | $pathRelativeToMount = substr($internalPath, strlen($cachedMountInfo->getRootInternalPath())); |
| 319 | 319 | $pathRelativeToMount = ltrim($pathRelativeToMount, '/'); |
| 320 | - $absolutePath = rtrim($cachedMountInfo->getMountPoint() . $pathRelativeToMount, '/'); |
|
| 320 | + $absolutePath = rtrim($cachedMountInfo->getMountPoint().$pathRelativeToMount, '/'); |
|
| 321 | 321 | return $this->root->createNode($absolutePath, new \OC\Files\FileInfo( |
| 322 | 322 | $absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount, |
| 323 | 323 | \OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount)) |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | $nodes = array_filter($nodes); |
| 328 | 328 | |
| 329 | - return array_filter($nodes, function (Node $node) { |
|
| 329 | + return array_filter($nodes, function(Node $node) { |
|
| 330 | 330 | return $this->getRelativePath($node->getPath()); |
| 331 | 331 | }); |
| 332 | 332 | } |
@@ -370,10 +370,10 @@ discard block |
||
| 370 | 370 | $mounts = $this->root->getMountsIn($this->path); |
| 371 | 371 | $mounts[] = $this->getMountPoint(); |
| 372 | 372 | |
| 373 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
| 373 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
| 374 | 374 | return $mount->getStorage(); |
| 375 | 375 | }); |
| 376 | - $storageIds = array_map(function (IMountPoint $mount) { |
|
| 376 | + $storageIds = array_map(function(IMountPoint $mount) { |
|
| 377 | 377 | return $mount->getStorage()->getCache()->getNumericStorageId(); |
| 378 | 378 | }, $mounts); |
| 379 | 379 | /** @var IMountPoint[] $mountMap */ |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | private function recentParse($result, $mountMap, $mimetypeLoader) { |
| 431 | - $files = array_filter(array_map(function (array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 431 | + $files = array_filter(array_map(function(array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 432 | 432 | $mount = $mountMap[$entry['storage']]; |
| 433 | 433 | $entry['internalPath'] = $entry['path']; |
| 434 | 434 | $entry['mimetype'] = $mimetypeLoader->getMimetypeById($entry['mimetype']); |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | return $this->root->createNode($fileInfo->getPath(), $fileInfo); |
| 442 | 442 | }, $result)); |
| 443 | 443 | |
| 444 | - return array_values(array_filter($files, function (Node $node) { |
|
| 444 | + return array_values(array_filter($files, function(Node $node) { |
|
| 445 | 445 | $cacheEntry = $node->getMountPoint()->getStorage()->getCache()->get($node->getId()); |
| 446 | 446 | if (!$cacheEntry) { |
| 447 | 447 | return false; |
@@ -463,13 +463,13 @@ discard block |
||
| 463 | 463 | $rootLength = strlen($jailRoot) + 1; |
| 464 | 464 | if ($path === $jailRoot) { |
| 465 | 465 | return $mount->getMountPoint(); |
| 466 | - } else if (substr($path, 0, $rootLength) === $jailRoot . '/') { |
|
| 467 | - return $mount->getMountPoint() . substr($path, $rootLength); |
|
| 466 | + } else if (substr($path, 0, $rootLength) === $jailRoot.'/') { |
|
| 467 | + return $mount->getMountPoint().substr($path, $rootLength); |
|
| 468 | 468 | } else { |
| 469 | 469 | return null; |
| 470 | 470 | } |
| 471 | 471 | } else { |
| 472 | - return $mount->getMountPoint() . $path; |
|
| 472 | + return $mount->getMountPoint().$path; |
|
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | } |