summaryrefslogtreecommitdiffstats
path: root/lib/private/Setup.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/Setup.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/Setup.php')
-rw-r--r--lib/private/Setup.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/private/Setup.php b/lib/private/Setup.php
index 8214db2d4ef..92246e8322e 100644
--- a/lib/private/Setup.php
+++ b/lib/private/Setup.php
@@ -65,6 +65,8 @@ class Setup {
protected $logger;
/** @var ISecureRandom */
protected $random;
+ /** @var Installer */
+ protected $installer;
/**
* @param SystemConfig $config
@@ -73,13 +75,15 @@ class Setup {
* @param Defaults $defaults
* @param ILogger $logger
* @param ISecureRandom $random
+ * @param Installer $installer
*/
public function __construct(SystemConfig $config,
IniGetWrapper $iniWrapper,
IL10N $l10n,
Defaults $defaults,
ILogger $logger,
- ISecureRandom $random
+ ISecureRandom $random,
+ Installer $installer
) {
$this->config = $config;
$this->iniWrapper = $iniWrapper;
@@ -87,6 +91,7 @@ class Setup {
$this->defaults = $defaults;
$this->logger = $logger;
$this->random = $random;
+ $this->installer = $installer;
}
static protected $dbSetupClasses = [
@@ -371,18 +376,11 @@ class Setup {
// Install shipped apps and specified app bundles
Installer::installShippedApps();
- $installer = new Installer(
- \OC::$server->getAppFetcher(),
- \OC::$server->getHTTPClientService(),
- \OC::$server->getTempManager(),
- \OC::$server->getLogger(),
- \OC::$server->getConfig()
- );
$bundleFetcher = new BundleFetcher(\OC::$server->getL10N('lib'));
$defaultInstallationBundles = $bundleFetcher->getDefaultInstallationBundle();
foreach($defaultInstallationBundles as $bundle) {
try {
- $installer->installAppBundle($bundle);
+ $this->installer->installAppBundle($bundle);
} catch (Exception $e) {}
}
@@ -444,9 +442,15 @@ class Setup {
$webRoot = !empty(\OC::$WEBROOT) ? \OC::$WEBROOT : '/';
}
- $setupHelper = new \OC\Setup($config, \OC::$server->getIniWrapper(),
- \OC::$server->getL10N('lib'), \OC::$server->query(Defaults::class), \OC::$server->getLogger(),
- \OC::$server->getSecureRandom());
+ $setupHelper = new \OC\Setup(
+ $config,
+ \OC::$server->getIniWrapper(),
+ \OC::$server->getL10N('lib'),
+ \OC::$server->query(Defaults::class),
+ \OC::$server->getLogger(),
+ \OC::$server->getSecureRandom(),
+ \OC::$server->query(Installer::class)
+ );
$htaccessContent = file_get_contents($setupHelper->pathToHtaccess());
$content = "#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####\n";