The other function doesn't work if the appstore is disabled
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
* @return integer
*/
public function installApp($appId) {
- $basedir = OC_App::getInstallPath().'/'.$appId;
+ $app = \OC_App::findAppInDirectories($appId);
+ if($app === false) {
+ throw new \Exception('App not found in any app directory');
+ }
+
+ $basedir = $app['path'].'/'.$appId;
$info = OC_App::getAppInfo($basedir.'/appinfo/info.xml', true);
//install the database
* @param string $appId
* @return false|string
*/
- protected static function findAppInDirectories($appId) {
+ public static function findAppInDirectories($appId) {
$sanitizedAppId = self::cleanAppId($appId);
if($sanitizedAppId !== $appId) {
return false;