summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-03-24 02:06:50 +0100
committerRobin Appelman <icewind@owncloud.com>2013-03-24 02:06:50 +0100
commit0e55b611693ffa2171844a476573ebfc211b35e8 (patch)
treeee5facb2ba4a206e73e30598383ecba3307d2625
parent24d471af294938a6f89af74710ecb8d6bd1e33b5 (diff)
downloadnextcloud-server-0e55b611693ffa2171844a476573ebfc211b35e8.tar.gz
nextcloud-server-0e55b611693ffa2171844a476573ebfc211b35e8.zip
Improve phpdoc for the filecache
-rw-r--r--lib/files/cache/legacy.php9
-rw-r--r--lib/files/cache/scanner.php2
-rw-r--r--lib/files/cache/updater.php18
-rw-r--r--lib/files/cache/upgrade.php13
4 files changed, 38 insertions, 4 deletions
diff --git a/lib/files/cache/legacy.php b/lib/files/cache/legacy.php
index 2b8689fcbda..eac2795d6df 100644
--- a/lib/files/cache/legacy.php
+++ b/lib/files/cache/legacy.php
@@ -20,6 +20,11 @@ class Legacy {
$this->user = $user;
}
+ /**
+ * get the numbers of items in the legacy cache
+ *
+ * @return int
+ */
function getCount() {
$query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?');
$result = $query->execute(array($this->user));
@@ -62,6 +67,8 @@ class Legacy {
}
/**
+ * get an item from the legacy cache
+ *
* @param string|int $path
* @return array
*/
@@ -76,6 +83,8 @@ class Legacy {
}
/**
+ * get all child items of an item from the legacy cache
+ *
* @param int $id
* @return array
*/
diff --git a/lib/files/cache/scanner.php b/lib/files/cache/scanner.php
index f285f3bed11..a1f688d3aca 100644
--- a/lib/files/cache/scanner.php
+++ b/lib/files/cache/scanner.php
@@ -91,7 +91,7 @@ class Scanner {
* scan all the files in a folder and store them in the cache
*
* @param string $path
- * @param SCAN_RECURSIVE/SCAN_SHALLOW $recursive
+ * @param bool $recursive
* @param bool $onlyChilds
* @return int the size of the scanned folder or -1 if the size is unknown at this stage
*/
diff --git a/lib/files/cache/updater.php b/lib/files/cache/updater.php
index e760ba71bc6..3c26ebeb491 100644
--- a/lib/files/cache/updater.php
+++ b/lib/files/cache/updater.php
@@ -16,7 +16,7 @@ class Updater {
/**
* resolve a path to a storage and internal path
*
- * @param string $path
+ * @param string $path the relative path
* @return array consisting of the storage and the internal path
*/
static public function resolvePath($path) {
@@ -24,6 +24,11 @@ class Updater {
return $view->resolvePath($path);
}
+ /**
+ * preform a write update
+ *
+ * @param string $path the relative path of the file
+ */
static public function writeUpdate($path) {
/**
* @var \OC\Files\Storage\Storage $storage
@@ -39,6 +44,11 @@ class Updater {
}
}
+ /**
+ * preform a delete update
+ *
+ * @param string $path the relative path of the file
+ */
static public function deleteUpdate($path) {
/**
* @var \OC\Files\Storage\Storage $storage
@@ -53,6 +63,12 @@ class Updater {
}
}
+ /**
+ * preform a rename update
+ *
+ * @param string $from the relative path of the source file
+ * @param string $to the relative path of the target file
+ */
static public function renameUpdate($from, $to) {
/**
* @var \OC\Files\Storage\Storage $storageFrom
diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php
index 230690d35c3..4d6c28de851 100644
--- a/lib/files/cache/upgrade.php
+++ b/lib/files/cache/upgrade.php
@@ -26,10 +26,10 @@ class Upgrade {
}
/**
- * Preform a shallow upgrade
+ * Preform a upgrade a path and it's childs
*
* @param string $path
- * @param int $mode
+ * @param bool $mode
*/
function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) {
if (!$this->legacy->hasItems()) {
@@ -47,7 +47,10 @@ class Upgrade {
}
/**
+ * upgrade all child elements of an item
+ *
* @param int $id
+ * @param bool $mode
*/
function upgradeChilds($id, $mode = Scanner::SCAN_RECURSIVE) {
$children = $this->legacy->getChildren($id);
@@ -64,6 +67,8 @@ class Upgrade {
}
/**
+ * insert data into the new cache
+ *
* @param array $data the data for the new cache
*/
function insert($data) {
@@ -79,6 +84,8 @@ class Upgrade {
}
/**
+ * check if an item is already in the new cache
+ *
* @param string $storage
* @param string $pathHash
* @param string $id
@@ -135,6 +142,8 @@ class Upgrade {
}
/**
+ * get the numeric id for a mimetype
+ *
* @param string $mimetype
* @param \OC\Files\Storage\Storage $storage
* @return int