diff options
Diffstat (limited to 'lib/private/Updater.php')
-rw-r--r-- | lib/private/Updater.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 4f5bb45ae15..5c8d5a2cd4e 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -63,6 +63,9 @@ class Updater extends BasicEmitter { /** @var Checker */ private $checker; + /** @var Installer */ + private $installer; + /** @var bool */ private $skip3rdPartyAppsDisable; @@ -78,13 +81,16 @@ class Updater extends BasicEmitter { * @param IConfig $config * @param Checker $checker * @param ILogger $log + * @param Installer $installer */ public function __construct(IConfig $config, Checker $checker, - ILogger $log = null) { + ILogger $log = null, + Installer $installer) { $this->log = $log; $this->config = $config; $this->checker = $checker; + $this->installer = $installer; // If at least PHP 7.0.0 is used we don't need to disable apps as we catch // fatal errors and exceptions and disable the app just instead. @@ -461,17 +467,10 @@ class Updater extends BasicEmitter { private function upgradeAppStoreApps(array $disabledApps) { foreach($disabledApps as $app) { try { - $installer = new Installer( - \OC::$server->getAppFetcher(), - \OC::$server->getHTTPClientService(), - \OC::$server->getTempManager(), - $this->log, - \OC::$server->getConfig() - ); $this->emit('\OC\Updater', 'checkAppStoreAppBefore', [$app]); if (Installer::isUpdateAvailable($app, \OC::$server->getAppFetcher())) { $this->emit('\OC\Updater', 'upgradeAppStoreApp', [$app]); - $installer->updateAppstoreApp($app); + $this->installer->updateAppstoreApp($app); } $this->emit('\OC\Updater', 'checkAppStoreApp', [$app]); } catch (\Exception $ex) { |