From 1331de554c0ab619df1826424e502803535481e2 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 19 Feb 2014 10:46:02 +0100 Subject: Reuse the folder id in View->getFolderContents --- lib/private/files/cache/cache.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/private/files/cache') diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 4cab4619149..dbdc42ecc48 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -162,10 +162,13 @@ class Cache { * get the metadata of all files stored in $folder * * @param string $folder + * @param int $fileId (optional) the file id of the folder * @return array */ - public function getFolderContents($folder) { - $fileId = $this->getId($folder); + public function getFolderContents($folder, $fileId = null) { + if (is_null($fileId)) { + $fileId = $this->getId($folder); + } if ($fileId > -1) { $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `unencrypted_size`, `etag` -- cgit v1.2.3 From dd98e6333f59de05e04a1bd6a887ff1554233e28 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 Feb 2014 15:35:12 +0100 Subject: Split getFolderContentById --- lib/private/files/cache/cache.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/private/files/cache') diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index dbdc42ecc48..fcc7099bbc9 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -169,6 +169,16 @@ class Cache { if (is_null($fileId)) { $fileId = $this->getId($folder); } + return $this->getFolderContentsById($fileId); + } + + /** + * get the metadata of all files stored in $folder + * + * @param int $fileId the file id of the folder + * @return array + */ + public function getFolderContentsById($fileId) { if ($fileId > -1) { $sql = 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `storage_mtime`, `encrypted`, `unencrypted_size`, `etag` -- cgit v1.2.3 From 3487a95eaba04e6ced29d86a7cba9151513a1703 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 Feb 2014 15:36:24 +0100 Subject: Remove fileid parameter for getFolderContent --- lib/private/files/cache/cache.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/private/files/cache') diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index fcc7099bbc9..9b18257088c 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -162,13 +162,10 @@ class Cache { * get the metadata of all files stored in $folder * * @param string $folder - * @param int $fileId (optional) the file id of the folder * @return array */ - public function getFolderContents($folder, $fileId = null) { - if (is_null($fileId)) { - $fileId = $this->getId($folder); - } + public function getFolderContents($folder) { + $fileId = $this->getId($folder); return $this->getFolderContentsById($fileId); } -- cgit v1.2.3