diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-03-22 09:55:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 09:55:19 +0100 |
commit | f843b7edfe7b3bc6e45d4610778d2df98b3985e3 (patch) | |
tree | 396188e1db0681fe4a3b3d55d3585b5915905bab /lib/private/Installer.php | |
parent | be35b54f69f7c54318adc3bb46d23506afcebd09 (diff) | |
parent | 514de5dfa18d92d2f7bb15c9840d685b25300f4c (diff) | |
download | nextcloud-server-f843b7edfe7b3bc6e45d4610778d2df98b3985e3.tar.gz nextcloud-server-f843b7edfe7b3bc6e45d4610778d2df98b3985e3.zip |
Merge pull request #8506 from nextcloud/use-appmanager
Use isInstalled of AppManger instead of reimplement it
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r-- | lib/private/Installer.php | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index ab0ef836fbb..1b40b4955d6 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -166,17 +166,6 @@ class Installer { } /** - * @brief checks whether or not an app is installed - * @param string $app app - * @returns bool - * - * Checks whether or not an app is installed, i.e. registered in apps table. - */ - public static function isInstalled( $app ) { - return (\OC::$server->getConfig()->getAppValue($app, "installed_version", null) !== null); - } - - /** * Updates the specified app from the appstore * * @param string $appId @@ -510,17 +499,19 @@ class Installer { * @return array Array of error messages (appid => Exception) */ public static function installShippedApps($softErrors = false) { + $appManager = \OC::$server->getAppManager(); + $config = \OC::$server->getConfig(); $errors = []; foreach(\OC::$APPSROOTS as $app_dir) { if($dir = opendir( $app_dir['path'] )) { while( false !== ( $filename = readdir( $dir ))) { if( $filename[0] !== '.' and is_dir($app_dir['path']."/$filename") ) { if( file_exists( $app_dir['path']."/$filename/appinfo/info.xml" )) { - if(!Installer::isInstalled($filename)) { + if($config->getAppValue($filename, "installed_version", null) === null) { $info=OC_App::getAppInfo($filename); $enabled = isset($info['default_enable']); - if (($enabled || in_array($filename, \OC::$server->getAppManager()->getAlwaysEnabledApps())) - && \OC::$server->getConfig()->getAppValue($filename, 'enabled') !== 'no') { + if (($enabled || in_array($filename, $appManager->getAlwaysEnabledApps())) + && $config->getAppValue($filename, 'enabled') !== 'no') { if ($softErrors) { try { Installer::installShippedApp($filename); @@ -534,7 +525,7 @@ class Installer { } else { Installer::installShippedApp($filename); } - \OC::$server->getConfig()->setAppValue($filename, 'enabled', 'yes'); + $config->setAppValue($filename, 'enabled', 'yes'); } } } |