Last modified: 2013-11-12 16:25:48 UTC
Currently, we initialize our settings array with the defaults, and then allow them to be overwritten in LocalSettings.php. This means however that the defaults must be fixed, and can not depend on global mediawiki settings, because these are not guaranteed to be defined yet (one notable example is $wgServer - it's only initialized after LocalSettings.php is complete, in Setup.php). To avoid this issues, we should just provide empty settings arrays, and apply default values later for all keys that have not been explicitly set in LocalSettings. "Later" here probably means when the SettingsArray is initialized by merging the different settings arrays. This would also allow defaults to depend on whether or not some other extension is loaded - e.g. have different defaults for the client if the repo is active locally.
The downside of this is that we can't have settings that *add* to default values, or replace parts of them. One notable example is the list of available data types: we would want to allow this list to be *expanded* in LocalSettings.php. Perhaps the solution is to allow *some* defaults to be evaluated late - perhaps by setting them to a callback, or by registering a callback in a separate array.
We now allow defaults to be specified using callbacks. A bit hackish, but powerful and functional.