diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 14:33:40 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 14:33:40 +0100 |
commit | fcec704174a384f93214a1f2b83bed385e763ff6 (patch) | |
tree | 61f3bae15b32fc157072ff1bf920eade7f35902b | |
parent | b7c0dc46bedea0729f27742b4ed15348b19004d9 (diff) | |
parent | 1d0724a7729ebcc22d286a240eac7363f1bb37d4 (diff) | |
download | nextcloud-server-fcec704174a384f93214a1f2b83bed385e763ff6.tar.gz nextcloud-server-fcec704174a384f93214a1f2b83bed385e763ff6.zip |
Merge pull request #21730 from owncloud/fix-install-of-shipped-apps
Fix installation of shipped apps
-rw-r--r-- | lib/private/installer.php | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/lib/private/installer.php b/lib/private/installer.php index ef5efb09b46..f30db9ca659 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -38,6 +38,9 @@ * */ +use OC\App\CodeChecker\CodeChecker; +use OC\App\CodeChecker\EmptyCheck; +use OC\App\CodeChecker\PrivateCheck; use OC\OCSClient; /** @@ -128,8 +131,8 @@ class OC_Installer{ } //run appinfo/install.php - if((!isset($data['noinstall']) or $data['noinstall']==false) and file_exists($basedir.'/appinfo/install.php')) { - include $basedir.'/appinfo/install.php'; + if((!isset($data['noinstall']) or $data['noinstall']==false)) { + self::includeAppScript($basedir . '/appinfo/install.php'); } //set the installed version @@ -560,15 +563,16 @@ class OC_Installer{ */ public static function installShippedApp($app) { //install the database - if(is_file(OC_App::getAppPath($app)."/appinfo/database.xml")) { - OC_DB::createDbFromStructure(OC_App::getAppPath($app)."/appinfo/database.xml"); + $appPath = OC_App::getAppPath($app); + if(is_file("$appPath/appinfo/database.xml")) { + OC_DB::createDbFromStructure("$appPath/appinfo/database.xml"); } //run appinfo/install.php - if(is_file(OC_App::getAppPath($app)."/appinfo/install.php")) { - include OC_App::getAppPath($app)."/appinfo/install.php"; - } - $info=OC_App::getAppInfo($app); + \OC::$loader->addValidRoot($appPath); + self::includeAppScript("$appPath/appinfo/install.php"); + + $info = OC_App::getAppInfo($app); if (is_null($info)) { return false; } @@ -604,9 +608,18 @@ class OC_Installer{ return true; } - $codeChecker = new \OC\App\CodeChecker(); + $codeChecker = new CodeChecker(new PrivateCheck(new EmptyCheck())); $errors = $codeChecker->analyseFolder($folder); return empty($errors); } + + /** + * @param $basedir + */ + private static function includeAppScript($script) { + if ( file_exists($script) ){ + include $script; + } + } } |