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 ).