summaryrefslogtreecommitdiffstats
path: root/lib/private/Updater.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-11-24 10:27:58 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-11-25 12:00:57 +0100
commit0e2f00ec59424b2ef5708a928856e2c75abe6deb (patch)
treecbd61c976a34b352bb8377899a244b66ff82f40d /lib/private/Updater.php
parenta97a290fd5ed06dfc33d2adeed5d3b7531674827 (diff)
downloadnextcloud-server-0e2f00ec59424b2ef5708a928856e2c75abe6deb.tar.gz
nextcloud-server-0e2f00ec59424b2ef5708a928856e2c75abe6deb.zip
Get the Installer via DI
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/Updater.php')
-rw-r--r--lib/private/Updater.php17
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) {