From: Chad Horohoe Date: Mon, 12 Dec 2011 15:11:08 +0000 (+0000) Subject: Separate Cli/Web logic for envCheckServer() per CR on r104576 X-Git-Tag: 1.31.0-rc.0~26046 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=590b7a0f54be6708318f11928b01fe4d9ea1a616;p=lhc%2Fweb%2Fwiklou.git Separate Cli/Web logic for envCheckServer() per CR on r104576 --- diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 2dbeefe3f0..f9afbb20fb 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -183,11 +183,8 @@ class CliInstaller extends Installer { return parent::envCheckPath(); } - protected function envCheckServer( $srv = null ) { - if ( $this->getVar( 'wgServer' ) ) { - $srv = $this->getVar( 'wgServer' ); - } - return parent::envCheckServer( $srv ); + protected function envGetDefaultServer() { + return $this->getVar( 'wgServer' ); } public function dirIsExecutable( $dir, $url ) { diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 20429b7564..d7d71389a2 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -855,17 +855,18 @@ abstract class Installer { /** * Environment check for the server hostname. */ - protected function envCheckServer( $srv = null ) { - if ( $srv ) { - // wgServer was pre-defined, perhaps by the cli installer - $server = $srv; - } else { - $server = WebRequest::detectServer(); - } + protected abstract function envCheckServer() { + $server = $this->envGetDefaultServer(); $this->showMessage( 'config-using-server', $server ); $this->setVar( 'wgServer', $server ); } + /** + * Helper function to be called from envCheckServer() + * @return String + */ + protected abstract function envGetDefaultServer(); + /** * Environment check for setting $IP and $wgScriptPath. * @return bool diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index bf2c18ccb2..519233e59f 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -1089,4 +1089,8 @@ class WebInstaller extends Installer { } return parent::envCheckPath(); } + + protected function envGetDefaultServer() { + return WebRequest::detectServer(); + } }