X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseInstaller.php;h=a2194528a3614d99cebe88a16df0c6edf0fbc839;hb=3f1474de5d9d3980acd895c9accfe361f8a6dbaf;hp=a146ae4ae8591fb29dab75200c1d5f708a27e201;hpb=3851367738f5c0ff8c82d54cd4c2e6a6eee0c463;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index a146ae4ae8..a2194528a3 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -23,6 +23,8 @@ use Wikimedia\Rdbms\LBFactorySingle; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; +use Wikimedia\Rdbms\DBExpectedError; +use Wikimedia\Rdbms\DBConnectionError; /** * Base class for DBMS-specific installation helper classes. @@ -35,8 +37,6 @@ abstract class DatabaseInstaller { /** * The Installer object. * - * @todo Naming this parent is confusing, 'installer' would be clearer. - * * @var WebInstaller */ public $parent; @@ -371,6 +371,7 @@ abstract class DatabaseInstaller { /** * Perform database upgrades * + * @suppress SecurityCheck-XSS Escaping provided by $this->outputHandler * @return bool */ public function doUpgrade() { @@ -620,7 +621,12 @@ abstract class DatabaseInstaller { return false; } - if ( !$this->db->selectDB( $this->getVar( 'wgDBname' ) ) ) { + try { + $this->db->selectDB( $this->getVar( 'wgDBname' ) ); + } catch ( DBConnectionError $e ) { + // Don't catch DBConnectionError + throw $e; + } catch ( DBExpectedError $e ) { return false; }