X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FInstaller.php;h=5dc3aeca9269dd5336a0de93885c1c5051a9c9ce;hp=33d4fccda0d9b4795dc1e2f6ee25e87d49197c2b;hb=4d10bb14e81aadb907a00e4bd13973ef668ab1f8;hpb=a3b4288eacd34869b13f59782b73c9ddb75e3523 diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 33d4fccda0..5dc3aeca92 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -105,8 +105,6 @@ abstract class Installer { protected static $dbTypes = [ 'mysql', 'postgres', - 'oracle', - 'mssql', 'sqlite', ]; @@ -756,6 +754,8 @@ abstract class Installer { */ protected function envCheckDB() { global $wgLang; + /** @var string|null $dbType The user-specified database type */ + $dbType = $this->getVar( 'wgDBtype' ); $allNames = []; @@ -768,25 +768,27 @@ abstract class Installer { $databases = $this->getCompiledDBs(); $databases = array_flip( $databases ); + $ok = true; foreach ( array_keys( $databases ) as $db ) { $installer = $this->getDBInstaller( $db ); $status = $installer->checkPrerequisites(); if ( !$status->isGood() ) { + if ( !$this instanceof WebInstaller && $db === $dbType ) { + // Strictly check the key database type instead of just outputting message + // Note: No perform this check run from the web installer, since this method always called by + // the welcome page under web installation, so $dbType will always be 'mysql' + $ok = false; + } $this->showStatusMessage( $status ); - } - if ( !$status->isOK() ) { unset( $databases[$db] ); } } $databases = array_flip( $databases ); if ( !$databases ) { $this->showError( 'config-no-db', $wgLang->commaList( $allNames ), count( $allNames ) ); - - // @todo FIXME: This only works for the web installer! return false; } - - return true; + return $ok; } /** @@ -1586,7 +1588,7 @@ abstract class Installer { * @param callable $startCB A callback array for the beginning of each step * @param callable $endCB A callback array for the end of each step * - * @return array Array of Status objects + * @return Status[] Array of Status objects */ public function performInstallation( $startCB, $endCB ) { $installResults = []; @@ -1764,7 +1766,9 @@ abstract class Installer { public static function overrideConfig() { // Use PHP's built-in session handling, since MediaWiki's // SessionHandler can't work before we have an object cache set up. - define( 'MW_NO_SESSION_HANDLER', 1 ); + if ( !defined( 'MW_NO_SESSION_HANDLER' ) ) { + define( 'MW_NO_SESSION_HANDLER', 1 ); + } // Don't access the database $GLOBALS['wgUseDatabaseMessages'] = false;