dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Use isset() to avoid an E_NOTICE about an undefined index"
[lhc/web/wiklou.git]
/
includes
/
installer
/
DatabaseInstaller.php
diff --git
a/includes/installer/DatabaseInstaller.php
b/includes/installer/DatabaseInstaller.php
index
a146ae4
..
6315de4
100644
(file)
--- 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\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.
/**
* Base class for DBMS-specific installation helper classes.
@@
-371,6
+373,7
@@
abstract class DatabaseInstaller {
/**
* Perform database upgrades
*
/**
* Perform database upgrades
*
+ * @suppress SecurityCheck-XSS Escaping provided by $this->outputHandler
* @return bool
*/
public function doUpgrade() {
* @return bool
*/
public function doUpgrade() {
@@
-620,7
+623,12
@@
abstract class DatabaseInstaller {
return false;
}
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;
}
return false;
}