From: Max Semenik Date: Fri, 19 Aug 2011 18:27:35 +0000 (+0000) Subject: Don't check for each database's availability twice. This halves the number of ugly... X-Git-Tag: 1.31.0-rc.0~28162 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=beb802a8cfa396fe509c7b6f9e708b82a4a2a6d9;p=lhc%2Fweb%2Fwiklou.git Don't check for each database's availability twice. This halves the number of ugly message boxes seen during CLI installation on Windows if Oracle is not installed, but its bindings for PHP are. --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 354475383d..a25a94dd51 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -333,12 +333,14 @@ abstract class Installer { $this->settings[$var] = $GLOBALS[$var]; } + $compiledDBs = array(); foreach ( self::getDBTypes() as $type ) { $installer = $this->getDBInstaller( $type ); if ( !$installer->isCompiled() ) { continue; } + $compiledDBs[] = $type; $defaults = $installer->getGlobalDefaults(); @@ -350,6 +352,7 @@ abstract class Installer { } } } + $this->setVar( '_CompiledDBs', $compiledDBs ); $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions; // language will be wrong :( @@ -622,19 +625,13 @@ abstract class Installer { protected function envCheckDB() { global $wgLang; - $compiledDBs = array(); $allNames = array(); foreach ( self::getDBTypes() as $name ) { - if ( $this->getDBInstaller( $name )->isCompiled() ) { - $compiledDBs[] = $name; - } - $allNames[] = wfMsg( 'config-type-' . $name ); + $allNames[] = wfMsg( "config-type-$name" ); } - $this->setVar( '_CompiledDBs', $compiledDBs ); - - if ( !$compiledDBs ) { + if ( !$this->getVar( '_CompiledDBs' ) ) { $this->showError( 'config-no-db', $wgLang->commaList( $allNames ) ); // @todo FIXME: This only works for the web installer! return false;