Last modified: 2013-10-10 00:02:20 UTC
Reading over Google App Engine's PHP environment, how things like the Memcache(d) libraries are setup so configuration is automatically injected under-the-hood, and looking at our mw-config/overrides.php for distributors hosts. I thought it might be useful to have some sort of AutoSettings for hosts that give explicit support for MediaWiki. AutoSettings.php would be loaded after DefaultSettings.php but before LocalSettings.php. The file itself – like mw-config/overrides.php – would be a mere stub and explicitly declared as something it's ok for 3rd parties to modify. Hosts could include documentation like 'Replace .../AutoSettings.php with the contents <?php require_once( "/node/path/to/some/common/AutoSettings.php" );' – and perhaps do that for mw-config/overrides.php too – which would contain some extra code added by the host. The file would allow the defaults in DefaultSettings.php to be overridden with defaults that work better in the hosting environment. For some examples of what a hosting environment could do inside of an AutoSettings.php: - Auto configure caching to use a series of Memcached servers they offer. - Change the defaults for $wgUseImageMagick $wgImageMagickConvertCommand $wgImageMagickIdentifyCommand to automatically point to the system installed ImageMagick instead of using gd by default. - Change the defaults for $wgJpegTran, $wgExiv2Command, $wgSVGConverters, the tidy executable, $wgDiff3, $wgDiff, $wgGitBin, and $wgPhpCli to use the correct paths. - Set $wgDirectoryMode to a default value that's more secure in the hosting environment. - Auto-configure $wgSMTP to send emails in a way that works efficiently for the hosting environment. - Auto-configure database settings for things like database host/port/type so only minimal config is required. Or auto-config DBservers or the load-balancer if they offer a standard cluster of replicated SQL servers. - Auto-configure squid if they offer it on behalf of the users. I suppose rather than simple AutoSettings.php another possibility might be for a host to use auto_prepend_file, a custom php extension, etc... and for us to provide an API the host can have it's PHP environment automatically hook into.