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
Update OOjs UI to v0.1.0-pre (0fbf6bd14e)
[lhc/web/wiklou.git]
/
includes
/
db
/
Database.php
diff --git
a/includes/db/Database.php
b/includes/db/Database.php
index
f7fe980
..
8c06ef4
100644
(file)
--- a/
includes/db/Database.php
+++ b/
includes/db/Database.php
@@
-806,7
+806,7
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
* database. Example uses in core:
* @see LoadBalancer::reallyOpenConnection()
* @see ForeignDBRepo::getMasterDB()
* database. Example uses in core:
* @see LoadBalancer::reallyOpenConnection()
* @see ForeignDBRepo::getMasterDB()
- * @see WebInstaller
_
DBConnect::execute()
+ * @see WebInstallerDBConnect::execute()
*
* @since 1.18
*
*
* @since 1.18
*
@@
-926,7
+926,6
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
if ( count( $this->mTrxIdleCallbacks ) ) { // sanity
throw new MWException( "Transaction idle callbacks still pending." );
}
if ( count( $this->mTrxIdleCallbacks ) ) { // sanity
throw new MWException( "Transaction idle callbacks still pending." );
}
- $this->mOpened = false;
if ( $this->mConn ) {
if ( $this->trxLevel() ) {
if ( !$this->mTrxAutomatic ) {
if ( $this->mConn ) {
if ( $this->trxLevel() ) {
if ( !$this->mTrxAutomatic ) {
@@
-937,13
+936,14
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
$this->commit( __METHOD__, 'flush' );
}
$this->commit( __METHOD__, 'flush' );
}
- $
ret
= $this->closeConnection();
+ $
closed
= $this->closeConnection();
$this->mConn = false;
$this->mConn = false;
-
- return $ret;
} else {
} else {
-
return
true;
+
$closed =
true;
}
}
+ $this->mOpened = false;
+
+ return $closed;
}
/**
}
/**
@@
-3417,6
+3417,11
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
$this->runOnTransactionIdleCallbacks();
}
$this->runOnTransactionIdleCallbacks();
}
+ # Avoid fatals if close() was called
+ if ( !$this->isOpen() ) {
+ throw new DBUnexpectedError( $this, "DB connection was already closed." );
+ }
+
$this->doBegin( $fname );
$this->mTrxFname = $fname;
$this->mTrxDoneWrites = false;
$this->doBegin( $fname );
$this->mTrxFname = $fname;
$this->mTrxDoneWrites = false;
@@
-3475,6
+3480,11
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
}
}
}
}
+ # Avoid fatals if close() was called
+ if ( !$this->isOpen() ) {
+ throw new DBUnexpectedError( $this, "DB connection was already closed." );
+ }
+
$this->runOnTransactionPreCommitCallbacks();
$this->doCommit( $fname );
if ( $this->mTrxDoneWrites ) {
$this->runOnTransactionPreCommitCallbacks();
$this->doCommit( $fname );
if ( $this->mTrxDoneWrites ) {
@@
-3525,6
+3535,11
@@
abstract class DatabaseBase implements IDatabase, DatabaseType {
}
}
}
}
+ # Avoid fatals if close() was called
+ if ( !$this->isOpen() ) {
+ throw new DBUnexpectedError( $this, "DB connection was already closed." );
+ }
+
$this->doRollback( $fname );
$this->mTrxIdleCallbacks = array(); // cancel
$this->mTrxPreCommitCallbacks = array(); // cancel
$this->doRollback( $fname );
$this->mTrxIdleCallbacks = array(); // cancel
$this->mTrxPreCommitCallbacks = array(); // cancel