Do not set wgServer in cli install unless explicitly passed
authorYuviPanda <yuvipanda@gmail.com>
Sun, 6 Oct 2013 19:41:18 +0000 (01:11 +0530)
committerYuviPanda <yuvipanda@gmail.com>
Thu, 10 Oct 2013 08:31:22 +0000 (14:01 +0530)
commit513a7198e88b60b4a740109218fa60fcd79db99e
tree1608c5f2313aeac0a60b6dd7c1970ccfc5a20a3a
parent7d1cd6c376c4ae941a8f654815daad75f0146b2e
Do not set wgServer in cli install unless explicitly passed

Currently, if we do not pass a wgServer value (via --server),
the CLI installer sets the value to the default value
specified in DefaultSettings.php - which is to 'guess' by
calling into WebRequest::detectServer. This yields terrible
results, since WebRequest::detectServer expects to be working
in the context of a Web Request - and hence with HTTP Host
header information. Since calling from the CLI does not give
it host header information, it falls back to 'localhost',
which is not the value you usually want.

If we just do not set wgServer when it is not specified,
it is automatically calculated on every request by
WebRequest::detectServer, which does a splendid job.

Bug: 55376
Change-Id: I5436dd8c340604cbb59406a507188e11c8f86e86
includes/installer/CliInstaller.php
includes/installer/Installer.php
includes/installer/LocalSettingsGenerator.php