diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-28 23:10:32 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-28 23:10:32 +0200 |
commit | 32721e7b075f9bf0c625cb6f0a6e12d913abe6fc (patch) | |
tree | 2b60522184204f5f4f815603098cf17a72116c61 /lib/cache | |
parent | 53e51fe46b3a78b117bd43de922c0fea67d49670 (diff) | |
download | nextcloud-server-32721e7b075f9bf0c625cb6f0a6e12d913abe6fc.tar.gz nextcloud-server-32721e7b075f9bf0c625cb6f0a6e12d913abe6fc.zip |
Remember storage view in OC_Cache_File
Diffstat (limited to 'lib/cache')
-rw-r--r-- | lib/cache/file.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/cache/file.php b/lib/cache/file.php index 7298ba9074c..fa62dd3b162 100644 --- a/lib/cache/file.php +++ b/lib/cache/file.php @@ -8,14 +8,19 @@ class OC_Cache_File{ + protected $storage; protected function getStorage() { + if (isset(self::$storage)) { + return self::$storage; + } if(OC_User::isLoggedIn()){ $subdir = 'cache'; $view = new OC_FilesystemView('/'.OC_User::getUser()); if(!$view->file_exists($subdir)) { $view->mkdir($subdir); } - return new OC_FilesystemView('/'.OC_User::getUser().'/'.$subdir); + self::$storage = new OC_FilesystemView('/'.OC_User::getUser().'/'.$subdir); + return self::$storage; }else{ OC_Log::write('core','Can\'t get cache storage, user not logged in', OC_Log::ERROR); return false; |