diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-11-24 12:27:58 +0300 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-11-25 14:00:57 +0300 |
commit | 0e2f00ec59424b2ef5708a928856e2c75abe6deb (patch) | |
tree | cbd61c976a34b352bb8377899a244b66ff82f40d /core/Command | |
parent | a97a290fd5ed06dfc33d2adeed5d3b7531674827 (diff) |
Get the Installer via DI
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/App/Install.php | 8 | ||||
-rw-r--r-- | core/Command/Maintenance/Install.php | 13 | ||||
-rw-r--r-- | core/Command/Upgrade.php | 8 |
3 files changed, 17 insertions, 12 deletions
diff --git a/core/Command/App/Install.php b/core/Command/App/Install.php index c8c4652d7ba..8f530975be9 100644 --- a/core/Command/App/Install.php +++ b/core/Command/App/Install.php @@ -51,13 +51,7 @@ class Install extends Command { } try { - $installer = new Installer( - \OC::$server->getAppFetcher(), - \OC::$server->getHTTPClientService(), - \OC::$server->getTempManager(), - \OC::$server->getLogger(), - \OC::$server->getConfig() - ); + $installer = \OC::$server->query(Installer::class); $installer->downloadApp($appId); $result = $installer->installApp($appId); } catch(\Exception $e) { diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index 755d3d386c1..be6a2da22c8 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -30,6 +30,7 @@ namespace OC\Core\Command\Maintenance; use InvalidArgumentException; +use OC\Installer; use OC\Setup; use OC\SystemConfig; use OCP\Defaults; @@ -73,9 +74,15 @@ class Install extends Command { // validate the environment $server = \OC::$server; - $setupHelper = new Setup($this->config, $server->getIniWrapper(), - $server->getL10N('lib'), $server->query(Defaults::class), $server->getLogger(), - $server->getSecureRandom()); + $setupHelper = new Setup( + $this->config, + $server->getIniWrapper(), + $server->getL10N('lib'), + $server->query(Defaults::class), + $server->getLogger(), + $server->getSecureRandom(), + \OC::$server->query(Installer::class) + ); $sysInfo = $setupHelper->getSystemInfo(true); $errors = $sysInfo['errors']; if (count($errors) > 0) { diff --git a/core/Command/Upgrade.php b/core/Command/Upgrade.php index 0877c19bc01..2a502dbe921 100644 --- a/core/Command/Upgrade.php +++ b/core/Command/Upgrade.php @@ -35,6 +35,7 @@ namespace OC\Core\Command; use OC\Console\TimestampFormatter; +use OC\Installer; use OC\Updater; use OCP\IConfig; use OCP\ILogger; @@ -63,11 +64,13 @@ class Upgrade extends Command { /** * @param IConfig $config * @param ILogger $logger + * @param Installer $installer */ - public function __construct(IConfig $config, ILogger $logger) { + public function __construct(IConfig $config, ILogger $logger, Installer $installer) { parent::__construct(); $this->config = $config; $this->logger = $logger; + $this->installer = $installer; } protected function configure() { @@ -101,7 +104,8 @@ class Upgrade extends Command { $updater = new Updater( $this->config, \OC::$server->getIntegrityCodeChecker(), - $this->logger + $this->logger, + $this->installer ); if ($input->getOption('no-app-disable')) { |