Skip to content
Snippets Groups Projects
Commit 24748ee1 authored by Robin Appelman's avatar Robin Appelman
Browse files

add convinience function to get filesystem view for app storage

parent c4a6b998
No related branches found
No related tags found
No related merge requests found
......@@ -403,4 +403,22 @@ class OC_App{
include OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php';
}
}
/**
* @param string appid
* @return OC_FilesystemView
*/
public static function getStorage($appid){
if(OC_App::isEnabled($appid)){//sanity check
if(OC_User::isLoggedIn()){
return new OC_FilesystemView('/'.OC_User::getUser().'/'.$appid);
}else{
OC_Log::write('core','Can\'t get app storage, app, user not logged in',OC_Log::ERROR);
return false;
}
}else{
OC_Log::write('core','Can\'t get app storage, app '.$appid.' not enabled',OC_Log::ERROR);
false;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment