Page MenuHomePhabricator

SettingsLoader: add support for wiki farms
Closed, ResolvedPublic

Description

SettingsLoader should provide a convenient way to load site-specific settings based on some property of the web request, such as the Host header or request URI. This allows for multi-tenant operation.

This requires:

  • A base directory where per-site settings files are located. if this base directory is defined, SettingsLoader will try to detect the correct one to load.
  • A callback for detecting the name of the requested site (and thus the filename to load). The default should support at least the Host header.

It should be possible to use this mechanism via a static settings file, without the need for a dynamic LocalSettings.php. However, a convenient way to use this from PHP should also exist, e.g:

$settingsLoader->loadSiteSettings( $siteName = null ).

If $siteName is not given, the callback will be used to detect it. There should also be a setter for this callback:
$settingsLoader->setSiteDetectionCallback( $callback ).

Event Timeline

Aklapper renamed this task from SettingsLoader: add suppor for wiki farms to SettingsLoader: add support for wiki farms.Nov 1 2021, 12:55 PM

Change 746014 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] Add wiki-farm support

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

daniel triaged this task as Medium priority.Jan 26 2022, 12:09 PM

@daniel: Hi, the patch in Gerrit has been merged. Can this task be resolved (via Add Action...Change Status in the dropdown menu), or is there more to do in this task? Asking as you are set as task assignee. Thanks in advance!