diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2013-09-19 12:32:32 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2013-09-19 12:32:32 +0200 |
commit | d5126dd6b4d1d07c1da4cee4de0e857e81df6c73 (patch) | |
tree | edad25845f3e6ad02281220ca8aa69769f72b705 /lib/cache.php | |
parent | 2ef0b58ff6434254510c8be9c940126883022d76 (diff) | |
parent | 69c28400b47a3a16ead6fc0d5ee5e2212d0d8ab0 (diff) | |
download | nextcloud-server-d5126dd6b4d1d07c1da4cee4de0e857e81df6c73.tar.gz nextcloud-server-d5126dd6b4d1d07c1da4cee4de0e857e81df6c73.zip |
Merge branch 'appframework-master' into server_folder_methods
Diffstat (limited to 'lib/cache.php')
-rw-r--r-- | lib/cache.php | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/cache.php b/lib/cache.php index 48b9964ba9d..a311f10a00f 100644 --- a/lib/cache.php +++ b/lib/cache.php @@ -6,34 +6,36 @@ * See the COPYING-README file. */ -class OC_Cache { +namespace OC; + +class Cache { /** - * @var OC_Cache $user_cache + * @var Cache $user_cache */ static protected $user_cache; /** - * @var OC_Cache $global_cache + * @var Cache $global_cache */ static protected $global_cache; /** * get the global cache - * @return OC_Cache + * @return Cache */ static public function getGlobalCache() { if (!self::$global_cache) { - self::$global_cache = new OC_Cache_FileGlobal(); + self::$global_cache = new Cache\FileGlobal(); } return self::$global_cache; } /** * get the user cache - * @return OC_Cache + * @return Cache */ static public function getUserCache() { if (!self::$user_cache) { - self::$user_cache = new OC_Cache_File(); + self::$user_cache = new Cache\File(); } return self::$user_cache; } @@ -85,7 +87,7 @@ class OC_Cache { /** * clear the user cache of all entries starting with a prefix - * @param string prefix (optional) + * @param string $prefix (optional) * @return bool */ static public function clear($prefix='') { @@ -93,6 +95,11 @@ class OC_Cache { return $user_cache->clear($prefix); } + /** + * creates cache key based on the files given + * @param $files + * @return string + */ static public function generateCacheKeyFromFiles($files) { $key = ''; sort($files); |