Improve phpdoc for the filecache

This commit is contained in:
Robin Appelman 2013-03-24 02:06:50 +01:00
parent 24d471af29
commit 0e55b61169
4 changed files with 38 additions and 4 deletions

View File

@ -20,6 +20,11 @@ class Legacy {
$this->user = $user; $this->user = $user;
} }
/**
* get the numbers of items in the legacy cache
*
* @return int
*/
function getCount() { function getCount() {
$query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?'); $query = \OC_DB::prepare('SELECT COUNT(`id`) AS `count` FROM `*PREFIX*fscache` WHERE `user` = ?');
$result = $query->execute(array($this->user)); $result = $query->execute(array($this->user));
@ -62,6 +67,8 @@ class Legacy {
} }
/** /**
* get an item from the legacy cache
*
* @param string|int $path * @param string|int $path
* @return array * @return array
*/ */
@ -76,6 +83,8 @@ class Legacy {
} }
/** /**
* get all child items of an item from the legacy cache
*
* @param int $id * @param int $id
* @return array * @return array
*/ */

View File

@ -91,7 +91,7 @@ class Scanner {
* scan all the files in a folder and store them in the cache * scan all the files in a folder and store them in the cache
* *
* @param string $path * @param string $path
* @param SCAN_RECURSIVE/SCAN_SHALLOW $recursive * @param bool $recursive
* @param bool $onlyChilds * @param bool $onlyChilds
* @return int the size of the scanned folder or -1 if the size is unknown at this stage * @return int the size of the scanned folder or -1 if the size is unknown at this stage
*/ */

View File

@ -16,7 +16,7 @@ class Updater {
/** /**
* resolve a path to a storage and internal path * 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 * @return array consisting of the storage and the internal path
*/ */
static public function resolvePath($path) { static public function resolvePath($path) {
@ -24,6 +24,11 @@ class Updater {
return $view->resolvePath($path); return $view->resolvePath($path);
} }
/**
* preform a write update
*
* @param string $path the relative path of the file
*/
static public function writeUpdate($path) { static public function writeUpdate($path) {
/** /**
* @var \OC\Files\Storage\Storage $storage * @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) { static public function deleteUpdate($path) {
/** /**
* @var \OC\Files\Storage\Storage $storage * @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) { static public function renameUpdate($from, $to) {
/** /**
* @var \OC\Files\Storage\Storage $storageFrom * @var \OC\Files\Storage\Storage $storageFrom

View File

@ -26,10 +26,10 @@ class Upgrade {
} }
/** /**
* Preform a shallow upgrade * Preform a upgrade a path and it's childs
* *
* @param string $path * @param string $path
* @param int $mode * @param bool $mode
*/ */
function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) { function upgradePath($path, $mode = Scanner::SCAN_RECURSIVE) {
if (!$this->legacy->hasItems()) { if (!$this->legacy->hasItems()) {
@ -47,7 +47,10 @@ class Upgrade {
} }
/** /**
* upgrade all child elements of an item
*
* @param int $id * @param int $id
* @param bool $mode
*/ */
function upgradeChilds($id, $mode = Scanner::SCAN_RECURSIVE) { function upgradeChilds($id, $mode = Scanner::SCAN_RECURSIVE) {
$children = $this->legacy->getChildren($id); $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 * @param array $data the data for the new cache
*/ */
function insert($data) { function insert($data) {
@ -79,6 +84,8 @@ class Upgrade {
} }
/** /**
* check if an item is already in the new cache
*
* @param string $storage * @param string $storage
* @param string $pathHash * @param string $pathHash
* @param string $id * @param string $id
@ -135,6 +142,8 @@ class Upgrade {
} }
/** /**
* get the numeric id for a mimetype
*
* @param string $mimetype * @param string $mimetype
* @param \OC\Files\Storage\Storage $storage * @param \OC\Files\Storage\Storage $storage
* @return int * @return int