summaryrefslogtreecommitdiffstats
path: root/lib/cache
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-28 23:10:32 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-28 23:10:32 +0200
commit32721e7b075f9bf0c625cb6f0a6e12d913abe6fc (patch)
tree2b60522184204f5f4f815603098cf17a72116c61 /lib/cache
parent53e51fe46b3a78b117bd43de922c0fea67d49670 (diff)
downloadnextcloud-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.php7
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;