* All updates for an event are atomic for the main DB.
* This follows-up
9e51328790c0a by reverting the auto-commit
behavoir which was a side-effect of that change.
* Added TitleMoveCompleting hook with is a pre-commit version
of the same hook. Various extension could benefit from the
atomicity of running in the main transaction.
Change-Id: Ife5990bbedca1de78bcf83f2d6fdeeae8086ffad
authentication extensions.
* $wgMaxUserDBWriteDuration added to limit huge user-generated transactions.
Regular web request transactions that takes longer than this are aborted.
+* Added a new hook, 'TitleMoveCompleting', which runs before a page move is committed.
=== External library changes in 1.27 ===
==== Upgraded external libraries ====
$nt: new title
$user: user who does the move
-'TitleMoveComplete': After moving an article (title).
+'TitleMoveComplete': After moving an article (title), post-commit.
&$old: old title
&$nt: new title
&$user: user who did the move
$redirid: database ID of the created redirect
$reason: reason for the move
+'TitleMoveCompleting': After moving an article (title), pre-commit.
+$old: old title
+$nt: new title
+$user: user who did the move
+$pageid: database ID of the page that's been moved
+$redirid: database ID of the created redirect
+$reason: reason for the move
+
'TitleQuickPermissions': Called from Title::checkQuickPermissions to add to
or override the quick permissions check.
$title: The Title object being accessed
WatchedItem::duplicateEntries( $this->oldTitle, $this->newTitle );
}
+ Hooks::run(
+ 'TitleMoveCompleting',
+ array( $this->oldTitle, $this->newTitle, $user, $pageid, $redirid, $reason )
+ );
+
$dbw->endAtomic( __METHOD__ );
$params = array( &$this->oldTitle, &$this->newTitle, &$user, $pageid, $redirid, $reason );
- $dbw->onTransactionIdle( function () use ( $params ) {
+ $dbw->onTransactionIdle( function () use ( $params, $dbw ) {
+ // Keep each single hook handler atomic
+ $dbw->setFlag( DBO_TRX ); // flag is automatically reset by DB layer
Hooks::run( 'TitleMoveComplete', $params );
} );