Use findAppInDirectories

The other function doesn't work if the appstore is disabled

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2016-10-31 17:30:02 +01:00
parent a68595742b
commit d805df7bb3
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 7 additions and 2 deletions

View File

@ -91,7 +91,12 @@ class Installer {
* @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

View File

@ -555,7 +555,7 @@ class OC_App {
* @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;