installer: Add support for PlatformSettings.php
[lhc/web/wiklou.git] / includes / installer / LocalSettingsGenerator.php
index a9710eb..6d70338 100644 (file)
@@ -41,8 +41,6 @@ class LocalSettingsGenerator {
        protected $installer;
 
        /**
-        * Constructor.
-        *
         * @param Installer $installer
         */
        public function __construct( Installer $installer ) {
@@ -187,7 +185,7 @@ class LocalSettingsGenerator {
                        $jsonFile = 'skin.json';
                        $function = 'wfLoadSkin';
                } else {
-                       throw new InvalidArgumentException( '$dir was not "extensions" or "skins' );
+                       throw new InvalidArgumentException( '$dir was not "extensions" or "skins"' );
                }
 
                $encName = self::escapePhpString( $name );
@@ -301,6 +299,12 @@ class LocalSettingsGenerator {
                }
 
                $mcservers = $this->buildMemcachedServerList();
+               if ( file_exists( dirname( __DIR__ ) . '/PlatformSettings.php' ) ) {
+                       $platformSettings = "\n## Include platform/distribution defaults";
+                       $platformSettings .= "\nrequire_once \"\$IP/includes/PlatformSettings.php\";";
+               } else {
+                       $platformSettings = '';
+               }
 
                return "<?php
 # This file was automatically generated by the MediaWiki {$GLOBALS['wgVersion']}
@@ -318,6 +322,7 @@ class LocalSettingsGenerator {
 if ( !defined( 'MEDIAWIKI' ) ) {
        exit;
 }
+{$platformSettings}
 
 ## Uncomment this to disable output compression
 # \$wgDisableOutputCompression = true;