Fix proper overwrite URL on CLI install

* regression from #7835

Steps

* having a my.config.php with a proper `overwrite.cli.url` and `htaccess.RewriteBase` set
* install with this
* before: short URLs where broken and you need to call `occ maintenance:update:htaccess` additionally to fix this
* after: occ install results in a proper htaccess like on stable13

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-02-07 11:40:35 +01:00
parent 8d57d68846
commit 4ee539fde8
No known key found for this signature in database
GPG key ID: FE03C3A163FEDE68

View file

@ -325,15 +325,20 @@ class Setup {
$secret = $this->random->generate(48);
//write the config file
$this->config->setValues([
$newConfigValues = [
'passwordsalt' => $salt,
'secret' => $secret,
'trusted_domains' => $trustedDomains,
'datadirectory' => $dataDir,
'overwrite.cli.url' => $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT,
'dbtype' => $dbType,
'version' => implode('.', \OCP\Util::getVersion()),
]);
];
if ($this->config->getValue('overwrite.cli.url', null) === null) {
$newConfigValues['overwrite.cli.url'] = $request->getServerProtocol() . '://' . $request->getInsecureServerHost() . \OC::$WEBROOT;
}
$this->config->setValues($newConfigValues);
try {
$dbSetup->initialize($options);