r112236 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112235‎ | r112236 | r112237 >
Date:20:01, 23 February 2012
Author:ialex
Status:ok
Tags:
Comment:
Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback()
Modified paths:
  • /trunk/phase3/includes/WikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WikiPage.php
@@ -905,7 +905,7 @@
906906 if ( $wgUseSquid ) {
907907 // Commit the transaction before the purge is sent
908908 $dbw = wfGetDB( DB_MASTER );
909 - $dbw->commit();
 909+ $dbw->commit( __METHOD__ );
910910
911911 // Send purge
912912 $update = SquidUpdate::newSimplePurge( $this->mTitle );
@@ -1329,7 +1329,7 @@
13301330 $changed = ( strcmp( $text, $oldtext ) != 0 );
13311331
13321332 if ( $changed ) {
1333 - $dbw->begin();
 1333+ $dbw->begin( __METHOD__ );
13341334 $revisionId = $revision->insertOn( $dbw );
13351335
13361336 # Update page
@@ -1351,7 +1351,7 @@
13521352 }
13531353
13541354 $revisionId = 0;
1355 - $dbw->rollback();
 1355+ $dbw->rollback( __METHOD__ );
13561356 } else {
13571357 global $wgUseRCPatrol;
13581358 wfRunHooks( 'NewRevisionFromEditComplete', array( $this, $revision, $baseRevId, $user ) );
@@ -1372,7 +1372,7 @@
13731373 }
13741374 }
13751375 $user->incEditCount();
1376 - $dbw->commit();
 1376+ $dbw->commit( __METHOD__ );
13771377 }
13781378 } else {
13791379 // Bug 32948: revision ID must be set to page {{REVISIONID}} and
@@ -1405,14 +1405,14 @@
14061406 # Create new article
14071407 $status->value['new'] = true;
14081408
1409 - $dbw->begin();
 1409+ $dbw->begin( __METHOD__ );
14101410
14111411 # Add the page record; stake our claim on this title!
14121412 # This will return false if the article already exists
14131413 $newid = $this->insertOn( $dbw );
14141414
14151415 if ( $newid === false ) {
1416 - $dbw->rollback();
 1416+ $dbw->rollback( __METHOD__ );
14171417 $status->fatal( 'edit-already-exists' );
14181418
14191419 wfProfileOut( __METHOD__ );
@@ -1453,7 +1453,7 @@
14541454 }
14551455 }
14561456 $user->incEditCount();
1457 - $dbw->commit();
 1457+ $dbw->commit( __METHOD__ );
14581458
14591459 # Update links, etc.
14601460 $this->doEditUpdates( $revision, $user, array( 'created' => true ) );
@@ -1985,7 +1985,7 @@
19861986 $bitfield = 'rev_deleted';
19871987 }
19881988
1989 - $dbw->begin();
 1989+ $dbw->begin( __METHOD__ );
19901990 // For now, shunt the revision data into the archive table.
19911991 // Text is *not* removed from the text table; bulk storage
19921992 // is left intact to avoid breaking block-compression or
@@ -2025,7 +2025,7 @@
20262026 $ok = ( $dbw->affectedRows() > 0 ); // getArticleId() uses slave, could be laggy
20272027
20282028 if ( !$ok ) {
2029 - $dbw->rollback();
 2029+ $dbw->rollback( __METHOD__ );
20302030 return WikiPage::DELETE_NO_REVISIONS;
20312031 }
20322032
@@ -2042,7 +2042,7 @@
20432043 $logEntry->publish( $logid );
20442044
20452045 if ( $commit ) {
2046 - $dbw->commit();
 2046+ $dbw->commit( __METHOD__ );
20472047 }
20482048
20492049 wfRunHooks( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id ) );

Sign-offs

UserFlagDate
Nikerabbitinspected09:11, 24 February 2012

Status & tagging log