@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | if (!$this->isValidPath($path)) { |
| 56 | 56 | throw new NotPermittedException('Invalid path'); |
| 57 | 57 | } |
| 58 | - return $this->path . $this->normalizePath($path); |
|
| 58 | + return $this->path.$this->normalizePath($path); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | if ($path === $this->path) { |
| 70 | 70 | return '/'; |
| 71 | - } else if (strpos($path, $this->path . '/') !== 0) { |
|
| 71 | + } else if (strpos($path, $this->path.'/') !== 0) { |
|
| 72 | 72 | return null; |
| 73 | 73 | } else { |
| 74 | 74 | $path = substr($path, strlen($this->path)); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @return bool |
| 84 | 84 | */ |
| 85 | 85 | public function isSubNode($node) { |
| 86 | - return strpos($node->getPath(), $this->path . '/') === 0; |
|
| 86 | + return strpos($node->getPath(), $this->path.'/') === 0; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | public function getDirectoryListing() { |
| 96 | 96 | $folderContent = $this->view->getDirectoryContent($this->path); |
| 97 | 97 | |
| 98 | - return array_map(function (FileInfo $info) { |
|
| 98 | + return array_map(function(FileInfo $info) { |
|
| 99 | 99 | if ($info->getMimetype() === 'httpd/unix-directory') { |
| 100 | 100 | return new Folder($this->root, $this->view, $info->getPath(), $info); |
| 101 | 101 | } else { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | public function search($query) { |
| 198 | 198 | if (is_string($query)) { |
| 199 | - return $this->searchCommon('search', array('%' . $query . '%')); |
|
| 199 | + return $this->searchCommon('search', array('%'.$query.'%')); |
|
| 200 | 200 | } else { |
| 201 | 201 | return $this->searchCommon('searchQuery', array($query)); |
| 202 | 202 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | $internalPath = $mount->getInternalPath($this->path); |
| 237 | 237 | $internalPath = rtrim($internalPath, '/'); |
| 238 | 238 | if ($internalPath !== '') { |
| 239 | - $internalPath = $internalPath . '/'; |
|
| 239 | + $internalPath = $internalPath.'/'; |
|
| 240 | 240 | } |
| 241 | 241 | $internalRootLength = strlen($internalPath); |
| 242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $result['internalPath'] = $result['path']; |
| 249 | 249 | $result['path'] = substr($result['path'], $internalRootLength); |
| 250 | 250 | $result['storage'] = $storage; |
| 251 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 251 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | |
@@ -262,14 +262,14 @@ discard block |
||
| 262 | 262 | $results = call_user_func_array(array($cache, $method), $args); |
| 263 | 263 | foreach ($results as $result) { |
| 264 | 264 | $result['internalPath'] = $result['path']; |
| 265 | - $result['path'] = $relativeMountPoint . $result['path']; |
|
| 265 | + $result['path'] = $relativeMountPoint.$result['path']; |
|
| 266 | 266 | $result['storage'] = $storage; |
| 267 | - $files[] = new \OC\Files\FileInfo($this->path . '/' . $result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 267 | + $files[] = new \OC\Files\FileInfo($this->path.'/'.$result['path'], $storage, $result['internalPath'], $result, $mount); |
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - return array_map(function (FileInfo $file) { |
|
| 272 | + return array_map(function(FileInfo $file) { |
|
| 273 | 273 | return $this->createNode($file->getPath(), $file); |
| 274 | 274 | }, $files); |
| 275 | 275 | } |
@@ -285,16 +285,16 @@ discard block |
||
| 285 | 285 | } else { |
| 286 | 286 | $user = null; |
| 287 | 287 | } |
| 288 | - $mountsContainingFile = $mountCache->getMountsForFileId((int)$id, $user); |
|
| 288 | + $mountsContainingFile = $mountCache->getMountsForFileId((int) $id, $user); |
|
| 289 | 289 | $mounts = $this->root->getMountsIn($this->path); |
| 290 | 290 | $mounts[] = $this->root->getMount($this->path); |
| 291 | 291 | /** @var IMountPoint[] $folderMounts */ |
| 292 | - $folderMounts = array_combine(array_map(function (IMountPoint $mountPoint) { |
|
| 292 | + $folderMounts = array_combine(array_map(function(IMountPoint $mountPoint) { |
|
| 293 | 293 | return $mountPoint->getMountPoint(); |
| 294 | 294 | }, $mounts), $mounts); |
| 295 | 295 | |
| 296 | 296 | /** @var ICachedMountInfo[] $mountsContainingFile */ |
| 297 | - $mountsContainingFile = array_values(array_filter($mountsContainingFile, function (ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 297 | + $mountsContainingFile = array_values(array_filter($mountsContainingFile, function(ICachedMountInfo $cachedMountInfo) use ($folderMounts) { |
|
| 298 | 298 | return isset($folderMounts[$cachedMountInfo->getMountPoint()]); |
| 299 | 299 | })); |
| 300 | 300 | |
@@ -302,18 +302,18 @@ discard block |
||
| 302 | 302 | return []; |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - $nodes = array_map(function (ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
| 305 | + $nodes = array_map(function(ICachedMountInfo $cachedMountInfo) use ($folderMounts, $id) { |
|
| 306 | 306 | $mount = $folderMounts[$cachedMountInfo->getMountPoint()]; |
| 307 | - $cacheEntry = $mount->getStorage()->getCache()->get((int)$id); |
|
| 307 | + $cacheEntry = $mount->getStorage()->getCache()->get((int) $id); |
|
| 308 | 308 | if (!$cacheEntry) { |
| 309 | 309 | return null; |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | // cache jails will hide the "true" internal path |
| 313 | - $internalPath = ltrim($cachedMountInfo->getRootInternalPath() . '/' . $cacheEntry->getPath(), '/'); |
|
| 313 | + $internalPath = ltrim($cachedMountInfo->getRootInternalPath().'/'.$cacheEntry->getPath(), '/'); |
|
| 314 | 314 | $pathRelativeToMount = substr($internalPath, strlen($cachedMountInfo->getRootInternalPath())); |
| 315 | 315 | $pathRelativeToMount = ltrim($pathRelativeToMount, '/'); |
| 316 | - $absolutePath = rtrim($cachedMountInfo->getMountPoint() . $pathRelativeToMount, '/'); |
|
| 316 | + $absolutePath = rtrim($cachedMountInfo->getMountPoint().$pathRelativeToMount, '/'); |
|
| 317 | 317 | return $this->root->createNode($absolutePath, new \OC\Files\FileInfo( |
| 318 | 318 | $absolutePath, $mount->getStorage(), $cacheEntry->getPath(), $cacheEntry, $mount, |
| 319 | 319 | \OC::$server->getUserManager()->get($mount->getStorage()->getOwner($pathRelativeToMount)) |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | |
| 323 | 323 | $nodes = array_filter($nodes); |
| 324 | 324 | |
| 325 | - return array_filter($nodes, function (Node $node) { |
|
| 325 | + return array_filter($nodes, function(Node $node) { |
|
| 326 | 326 | return $this->getRelativePath($node->getPath()); |
| 327 | 327 | }); |
| 328 | 328 | } |
@@ -366,10 +366,10 @@ discard block |
||
| 366 | 366 | $mounts = $this->root->getMountsIn($this->path); |
| 367 | 367 | $mounts[] = $this->getMountPoint(); |
| 368 | 368 | |
| 369 | - $mounts = array_filter($mounts, function (IMountPoint $mount) { |
|
| 369 | + $mounts = array_filter($mounts, function(IMountPoint $mount) { |
|
| 370 | 370 | return $mount->getStorage(); |
| 371 | 371 | }); |
| 372 | - $storageIds = array_map(function (IMountPoint $mount) { |
|
| 372 | + $storageIds = array_map(function(IMountPoint $mount) { |
|
| 373 | 373 | return $mount->getStorage()->getCache()->getNumericStorageId(); |
| 374 | 374 | }, $mounts); |
| 375 | 375 | /** @var IMountPoint[] $mountMap */ |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | $result = $query->execute()->fetchAll(); |
| 396 | 396 | |
| 397 | - $files = array_filter(array_map(function (array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 397 | + $files = array_filter(array_map(function(array $entry) use ($mountMap, $mimetypeLoader) { |
|
| 398 | 398 | $mount = $mountMap[$entry['storage']]; |
| 399 | 399 | $entry['internalPath'] = $entry['path']; |
| 400 | 400 | $entry['mimetype'] = $mimetypeLoader->getMimetypeById($entry['mimetype']); |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | return $this->root->createNode($fileInfo->getPath(), $fileInfo); |
| 408 | 408 | }, $result)); |
| 409 | 409 | |
| 410 | - return array_values(array_filter($files, function (Node $node) { |
|
| 410 | + return array_values(array_filter($files, function(Node $node) { |
|
| 411 | 411 | $relative = $this->getRelativePath($node->getPath()); |
| 412 | 412 | return $relative !== null && $relative !== '/'; |
| 413 | 413 | })); |
@@ -421,13 +421,13 @@ discard block |
||
| 421 | 421 | $rootLength = strlen($jailRoot) + 1; |
| 422 | 422 | if ($path === $jailRoot) { |
| 423 | 423 | return $mount->getMountPoint(); |
| 424 | - } else if (substr($path, 0, $rootLength) === $jailRoot . '/') { |
|
| 425 | - return $mount->getMountPoint() . substr($path, $rootLength); |
|
| 424 | + } else if (substr($path, 0, $rootLength) === $jailRoot.'/') { |
|
| 425 | + return $mount->getMountPoint().substr($path, $rootLength); |
|
| 426 | 426 | } else { |
| 427 | 427 | return null; |
| 428 | 428 | } |
| 429 | 429 | } else { |
| 430 | - return $mount->getMountPoint() . $path; |
|
| 430 | + return $mount->getMountPoint().$path; |
|
| 431 | 431 | } |
| 432 | 432 | } |
| 433 | 433 | } |