From 0e2f00ec59424b2ef5708a928856e2c75abe6deb Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 24 Nov 2017 10:27:58 +0100 Subject: Get the Installer via DI Signed-off-by: Morris Jobke --- lib/private/legacy/app.php | 16 ++-------------- lib/private/legacy/util.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 16 deletions(-) (limited to 'lib/private/legacy') diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index d2b0f96d593..1b9fc28873e 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -375,13 +375,7 @@ class OC_App { self::$enabledAppsCache = []; // flush // Check if app is already downloaded - $installer = new Installer( - \OC::$server->getAppFetcher(), - \OC::$server->getHTTPClientService(), - \OC::$server->getTempManager(), - \OC::$server->getLogger(), - \OC::$server->getConfig() - ); + $installer = \OC::$server->query(Installer::class); $isDownloaded = $installer->isDownloaded($appId); if(!$isDownloaded) { @@ -415,13 +409,7 @@ class OC_App { return false; } - $installer = new Installer( - \OC::$server->getAppFetcher(), - \OC::$server->getHTTPClientService(), - \OC::$server->getTempManager(), - \OC::$server->getLogger(), - \OC::$server->getConfig() - ); + $installer = \OC::$server->query(Installer::class); return $installer->removeApp($app); } diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index 1e9090960c1..3ce11746672 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -708,8 +708,15 @@ class OC_Util { } $webServerRestart = false; - $setup = new \OC\Setup($config, \OC::$server->getIniWrapper(), \OC::$server->getL10N('lib'), - \OC::$server->query(\OCP\Defaults::class), \OC::$server->getLogger(), \OC::$server->getSecureRandom()); + $setup = new \OC\Setup( + $config, + \OC::$server->getIniWrapper(), + \OC::$server->getL10N('lib'), + \OC::$server->query(\OCP\Defaults::class), + \OC::$server->getLogger(), + \OC::$server->getSecureRandom(), + \OC::$server->query(\OC\Installer::class) + ); $urlGenerator = \OC::$server->getURLGenerator(); -- cgit v1.2.3