}
protected function envGetDefaultServer() {
- return $this->getVar( 'wgServer' );
+ return null; // Do not guess if installing from CLI
}
public function dirIsExecutable( $dir, $url ) {
'wgImageMagickConvertCommand',
'wgGitBin',
'IP',
- 'wgServer',
'wgScriptPath',
'wgScriptExtension',
'wgMetaNamespace',
*/
protected function envCheckServer() {
$server = $this->envGetDefaultServer();
- $this->showMessage( 'config-using-server', $server );
- $this->setVar( 'wgServer', $server );
-
+ if ( $server !== null ) {
+ $this->showMessage( 'config-using-server', $server );
+ $this->setVar( 'wgServer', $server );
+ }
return true;
}
$val = wfBoolToStr( $val );
}
- if ( !in_array( $c, $unescaped ) ) {
+ if ( !in_array( $c, $unescaped ) && $val !== null ) {
$val = self::escapePhpString( $val );
}
}
}
+ $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':
## 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\";