From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/deferred/DeferredUpdates.php | 136 ++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 includes/deferred/DeferredUpdates.php (limited to 'includes/deferred/DeferredUpdates.php') diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php new file mode 100644 index 00000000..b0c1899f --- /dev/null +++ b/includes/deferred/DeferredUpdates.php @@ -0,0 +1,136 @@ +doUpdate(); + + if ( $doCommit && $dbw->trxLevel() ) { + $dbw->commit( __METHOD__, 'flush' ); + } + } catch ( MWException $e ) { + // We don't want exceptions thrown during deferred updates to + // be reported to the user since the output is already sent. + // Instead we just log them. + if ( !$e instanceof ErrorPageError ) { + MWExceptionHandler::logException( $e ); + } + } + } + $updates = array_merge( $wgDeferredUpdateList, self::$updates ); + } + + wfProfileOut( __METHOD__ ); + } + + /** + * Clear all pending updates without performing them. Generally, you don't + * want or need to call this. Unit tests need it though. + */ + public static function clearPendingUpdates() { + global $wgDeferredUpdateList; + $wgDeferredUpdateList = self::$updates = array(); + } +} -- cgit v1.2.2