diff options
Diffstat (limited to 'lib/private/cache/fileglobal.php')
-rw-r--r-- | lib/private/cache/fileglobal.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/cache/fileglobal.php b/lib/private/cache/fileglobal.php index bd049bba4d0..d9e0fd46d37 100644 --- a/lib/private/cache/fileglobal.php +++ b/lib/private/cache/fileglobal.php @@ -21,6 +21,9 @@ class FileGlobal { return str_replace('/', '_', $key); } + /** + * @param string $key + */ public function get($key) { $key = $this->fixKey($key); if ($this->hasKey($key)) { @@ -30,6 +33,10 @@ class FileGlobal { return null; } + /** + * @param string $key + * @param string $value + */ public function set($key, $value, $ttl=0) { $key = $this->fixKey($key); $cache_dir = self::getCacheDir(); @@ -81,13 +88,14 @@ class FileGlobal { } static public function gc() { - $last_run = \OC_AppConfig::getValue('core', 'global_cache_gc_lastrun', 0); + $appConfig = \OC::$server->getAppConfig(); + $last_run = $appConfig->getValue('core', 'global_cache_gc_lastrun', 0); $now = time(); if (($now - $last_run) < 300) { // only do cleanup every 5 minutes return; } - \OC_AppConfig::setValue('core', 'global_cache_gc_lastrun', $now); + $appConfig->setValue('core', 'global_cache_gc_lastrun', $now); $cache_dir = self::getCacheDir(); if($cache_dir and is_dir($cache_dir)) { $dh=opendir($cache_dir); |