Skip to content
Snippets Groups Projects
Commit 32721e7b authored by Bart Visscher's avatar Bart Visscher
Browse files

Remember storage view in OC_Cache_File

parent 53e51fe4
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment