diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-24 10:41:51 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-11-25 12:01:02 +0100 |
commit | df61d43529418aace241b99be106ff9a35188dac (patch) | |
tree | 1dee18bbed4828e67b96f87c41f3a43f799fd822 /settings | |
parent | 0e2f00ec59424b2ef5708a928856e2c75abe6deb (diff) | |
download | nextcloud-server-df61d43529418aace241b99be106ff9a35188dac.tar.gz nextcloud-server-df61d43529418aace241b99be106ff9a35188dac.zip |
Make isUpdateAvailable non-static
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/AppSettingsController.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php index 26858eabcf3..f2a92b52f6d 100644 --- a/settings/Controller/AppSettingsController.php +++ b/settings/Controller/AppSettingsController.php @@ -37,6 +37,7 @@ use OC\App\AppStore\Fetcher\CategoryFetcher; use OC\App\AppStore\Version\VersionParser; use OC\App\DependencyAnalyzer; use OC\App\Platform; +use OC\Installer; use OCP\App\IAppManager; use \OCP\AppFramework\Controller; use OCP\AppFramework\Http\ContentSecurityPolicy; @@ -74,6 +75,8 @@ class AppSettingsController extends Controller { private $l10nFactory; /** @var BundleFetcher */ private $bundleFetcher; + /** @var Installer */ + private $installer; /** * @param string $appName @@ -86,6 +89,7 @@ class AppSettingsController extends Controller { * @param AppFetcher $appFetcher * @param IFactory $l10nFactory * @param BundleFetcher $bundleFetcher + * @param Installer $installer */ public function __construct($appName, IRequest $request, @@ -96,7 +100,8 @@ class AppSettingsController extends Controller { CategoryFetcher $categoryFetcher, AppFetcher $appFetcher, IFactory $l10nFactory, - BundleFetcher $bundleFetcher) { + BundleFetcher $bundleFetcher, + Installer $installer) { parent::__construct($appName, $request); $this->l10n = $l10n; $this->config = $config; @@ -106,6 +111,7 @@ class AppSettingsController extends Controller { $this->appFetcher = $appFetcher; $this->l10nFactory = $l10nFactory; $this->bundleFetcher = $bundleFetcher; + $this->installer = $installer; } /** @@ -270,8 +276,7 @@ class AppSettingsController extends Controller { ]; - $appFetcher = \OC::$server->getAppFetcher(); - $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $appFetcher); + $newVersion = $this->installer->isUpdateAvailable($app['id']); if($newVersion && $this->appManager->isInstalled($app['id'])) { $formattedApps[count($formattedApps)-1]['update'] = $newVersion; } @@ -284,7 +289,7 @@ class AppSettingsController extends Controller { $appClass = new \OC_App(); $apps = $appClass->listAllApps(); foreach($apps as $key => $app) { - $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); + $newVersion = $this->installer->isUpdateAvailable($app['id']); if($newVersion !== false) { $apps[$key]['update'] = $newVersion; } else { @@ -317,7 +322,7 @@ class AppSettingsController extends Controller { $apps = $appClass->listAllApps(); foreach($apps as $key => $app) { - $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); + $newVersion = $this->installer->isUpdateAvailable($app['id']); $apps[$key]['update'] = $newVersion; } @@ -342,7 +347,7 @@ class AppSettingsController extends Controller { }); foreach($apps as $key => $app) { - $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); + $newVersion = $this->installer->isUpdateAvailable($app['id']); $apps[$key]['update'] = $newVersion; } @@ -363,7 +368,7 @@ class AppSettingsController extends Controller { }); $apps = array_map(function ($app) { - $newVersion = \OC\Installer::isUpdateAvailable($app['id'], $this->appFetcher); + $newVersion = $this->installer->isUpdateAvailable($app['id']); if ($newVersion !== false) { $app['update'] = $newVersion; } |