aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/files/cache/storage.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/cache/storage.php')
-rw-r--r--lib/private/files/cache/storage.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/private/files/cache/storage.php b/lib/private/files/cache/storage.php
index 2007f0c9e3d..ebef245f399 100644
--- a/lib/private/files/cache/storage.php
+++ b/lib/private/files/cache/storage.php
@@ -27,9 +27,13 @@
namespace OC\Files\Cache;
/**
- * Class Storage
+ * Handle the mapping between the string and numeric storage ids
*
- * cache storage specific data
+ * Each storage has 2 different ids
+ * a string id which is generated by the storage backend and reflects the configuration of the storage (e.g. 'smb://user@host/share')
+ * and a numeric storage id which is referenced in the file cache
+ *
+ * A mapping between the two storage ids is stored in the database and accessible trough this class
*
* @package OC\Files\Cache
*/
@@ -71,7 +75,7 @@ class Storage {
/**
* Adjusts the storage id to use md5 if too long
* @param string $storageId storage id
- * @return unchanged $storageId if its length is less than 64 characters,
+ * @return string unchanged $storageId if its length is less than 64 characters,
* else returns the md5 of $storageId
*/
public static function adjustStorageId($storageId) {
@@ -82,14 +86,19 @@ class Storage {
}
/**
- * @return string
+ * Get the numeric id for the storage
+ *
+ * @return int
*/
public function getNumericId() {
return $this->numericId;
}
/**
- * @return string|null
+ * Get the string id for the storage
+ *
+ * @param int $numericId
+ * @return string|null either the storage id string or null if the numeric id is not known
*/
public static function getStorageId($numericId) {
@@ -103,7 +112,10 @@ class Storage {
}
/**
- * @return string|null
+ * Get the numeric of the storage with the provided string id
+ *
+ * @param $storageId
+ * @return int|null either the numeric storage id or null if the storage id is not knwon
*/
public static function getNumericStorageId($storageId) {
$storageId = self::adjustStorageId($storageId);
@@ -118,6 +130,8 @@ class Storage {
}
/**
+ * Check if a string storage id is known
+ *
* @param string $storageId
* @return bool
*/