Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
[lhc/web/wiklou.git] / includes / libs / rdbms / database / Database.php
index 8da1ca9..aeda5b9 100644 (file)
@@ -677,6 +677,10 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                );
        }
 
+       public function preCommitCallbacksPending() {
+               return $this->trxLevel && $this->trxPreCommitCallbacks;
+       }
+
        /**
         * @return string|null
         */
@@ -3288,7 +3292,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                $this->trxEndCallbacks[] = [ $callback, $fname, $this->currentAtomicSectionId() ];
        }
 
-       final public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
+       final public function onTransactionCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
                if ( !$this->trxLevel && $this->getTransactionRoundId() ) {
                        // Start an implicit transaction similar to how query() does
                        $this->begin( __METHOD__, self::TRANSACTION_INTERNAL );
@@ -3301,6 +3305,10 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                }
        }
 
+       final public function onTransactionIdle( callable $callback, $fname = __METHOD__ ) {
+               $this->onTransactionCommitOrIdle( $callback, $fname );
+       }
+
        final public function onTransactionPreCommitOrIdle( callable $callback, $fname = __METHOD__ ) {
                if ( !$this->trxLevel && $this->getTransactionRoundId() ) {
                        // Start an implicit transaction similar to how query() does