Merge "Use i18n instead of hardcoded brackets and spaces"
[lhc/web/wiklou.git] / includes / installer / LocalSettingsGenerator.php
index 3a9bfe8..56d8353 100644 (file)
@@ -80,7 +80,7 @@ class LocalSettingsGenerator {
                                $val = wfBoolToStr( $val );
                        }
 
-                       if ( !in_array( $c, $unescaped ) ) {
+                       if ( !in_array( $c, $unescaped ) && $val !== null ) {
                                $val = self::escapePhpString( $val );
                        }
 
@@ -202,7 +202,7 @@ class LocalSettingsGenerator {
                        $locale = '';
                }
 
-               //$rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; // TODO: Fixme, I'm unused!
+               //$rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; // @todo FIXME: I'm unused!
                $hashedUploads = $this->safeMode ? '' : '#';
                $metaNamespace = '';
                if ( $this->values['wgMetaNamespace'] !== $this->values['wgSitename'] ) {
@@ -222,6 +222,12 @@ class LocalSettingsGenerator {
                        }
                }
 
+               $wgServerSetting = "";
+               if ( array_key_exists( 'wgServer', $this->values ) && $this->values['wgServer'] !== null ) {
+                       $wgServerSetting = "\n## The protocol and server name to use in fully-qualified URLs\n";
+                       $wgServerSetting .= "\$wgServer = \"{$this->values['wgServer']}\";\n";
+               }
+
                switch ( $this->values['wgMainCacheType'] ) {
                        case 'anything':
                        case 'db':
@@ -235,6 +241,7 @@ class LocalSettingsGenerator {
                }
 
                $mcservers = $this->buildMemcachedServerList();
+
                return "<?php
 # This file was automatically generated by the MediaWiki {$GLOBALS['wgVersion']}
 # installer. If you make manual changes, please keep track in case you
@@ -264,10 +271,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 ## http://www.mediawiki.org/wiki/Manual:Short_URL
 \$wgScriptPath = \"{$this->values['wgScriptPath']}\";
 \$wgScriptExtension = \"{$this->values['wgScriptExtension']}\";
-
-## The protocol and server name to use in fully-qualified URLs
-\$wgServer = \"{$this->values['wgServer']}\";
-
+${wgServerSetting}
 ## The relative URL path to the skins directory
 \$wgStylePath = \"\$wgScriptPath/skins\";
 
@@ -349,13 +353,6 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 # Path to the GNU diff3 utility. Used for conflict resolution.
 \$wgDiff3 = \"{$this->values['wgDiff3']}\";
 
-# Query string length limit for ResourceLoader. You should only set this if
-# your web server has a query string length limit (then set it to that limit),
-# or if you have suhosin.get.max_value_length set in php.ini (then set it to
-# that value)
-\$wgResourceLoaderMaxQueryLength = {$this->values['wgResourceLoaderMaxQueryLength']};
-
 {$groupRights}";
        }
-
 }