Page MenuHomePhabricator

If LocalSettings.php exists, but database is empty, user should be prompted to install and not download new LocalSettings.php
Open, Needs TriagePublic

Description

If you have a LocalSettings.php in place, but an empty database, going to index.php results in an error. If you go to /mw-config you go through the installation wizard, but then are prompted to download the updated LocalSettings.php again.

I think this should be updated in this way:

  1. If a LocalSettings.php file exists and a database connection can be made, but the database is empty, the user should be prompted to install MediaWiki. The install wizard should only ask you questions whose answers do not need to modify LocalSettings.php (i.e. it should ask for the admin user/password, but not the wiki name).
  2. If a LocalSettings.php file exists but a database connection cannot be made, then the install wizard should proceed as normal, but should append any needed changes to the end of the existing LocalSettings.php before asking the user to download the updated file.

The only alternative I can think of is for the web server to update the file, but since we don't do that already, it's probably a bad time to start.

Event Timeline

Change 372188 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/core@master] WIP: Determine if LocalSettings.php exists and database is empty

https://gerrit.wikimedia.org/r/372188

After some more thought, perhaps it would be better if we allowed all of the config to be set with environment variables? This issue would still exist, but you technically wouldn't need LocalSettings.php ever (as long as the database connection was successful).

I created T173955: Allow additional LocalSettings to be overriden by environment variables that should probably be done as well, but is not a strict dependency for this issue (other than a LocalSettings.php would not have to exist at all).