]> source.dussan.org Git - nextcloud-server.git/commitdiff
Improve phpdoc for the filecache
authorRobin Appelman <icewind@owncloud.com>
Sun, 24 Mar 2013 01:06:50 +0000 (02:06 +0100)
committerRobin Appelman <icewind@owncloud.com>
Sun, 24 Mar 2013 01:06:50 +0000 (02:06 +0100)
lib/files/cache/legacy.php
lib/files/cache/scanner.php
lib/files/cache/updater.php
lib/files/cache/upgrade.php

index 2b8689fcbda3671735d60243c5cb19f280989cbe..eac2795d6dfcb04ffa9e3c2171455dd77f0586ba 100644 (file)
@@ -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
         */
index f285f3bed112adb7260da344ccb79a2ab692e89c..a1f688d3aca0a2399c4d03ef09c45b1d230dccd3 100644 (file)
@@ -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
         */
index e760ba71bc6625e521fca200ed5a071d5b4f173f..3c26ebeb49135a65f0bc0f3e9aec1c19c990d564 100644 (file)
@@ -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
index 230690d35c35e466b0cd939775bbb1c89f92a2d3..4d6c28de8511da394512c91df958eb8b8ca43340 100644 (file)
@@ -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