More __METHOD__ into db related methods

This commit is contained in:
Sam Reed 2012-02-24 17:00:52 +00:00
parent fc324a18d2
commit 60081e9852
6 changed files with 13 additions and 13 deletions

View file

@ -260,7 +260,7 @@ class Category {
}
$dbw = wfGetDB( DB_MASTER );
$dbw->begin();
$dbw->begin( __METHOD__ );
# Insert the row if it doesn't exist yet (e.g., this is being run via
# update.php from a pre-1.16 schema). TODO: This will cause lots and
@ -300,7 +300,7 @@ class Category {
array( 'cat_title' => $this->mName ),
__METHOD__
);
$dbw->commit();
$dbw->commit( __METHOD__ );
# Now we should update our local counts.
$this->mPages = $result->pages;

View file

@ -154,14 +154,14 @@ class FileDeleteForm {
if ( $page->doDeleteArticleReal( $reason, $suppress, 0, false, $error, $user ) >= WikiPage::DELETE_SUCCESS ) {
$status = $file->delete( $reason, $suppress );
if( $status->isOK() ) {
$dbw->commit();
$dbw->commit( __METHOD__ );
} else {
$dbw->rollback();
$dbw->rollback( __METHOD__ );
}
}
} catch ( MWException $e ) {
// rollback before returning to prevent UI from displaying incorrect "View or restore N deleted edits?"
$dbw->rollback();
$dbw->rollback( __METHOD__ );
throw $e;
}
}

View file

@ -64,7 +64,7 @@ class LocalRepo extends FileRepo {
foreach ( $storageKeys as $key ) {
$hashPath = $this->getDeletedHashPath( $key );
$path = "$root/$hashPath$key";
$dbw->begin();
$dbw->begin( __METHOD__ );
// Check for usage in deleted/hidden files and pre-emptively
// lock the key to avoid any future use until we are finished.
$deleted = $this->deletedFileHasKey( $key, 'lock' );
@ -80,7 +80,7 @@ class LocalRepo extends FileRepo {
wfDebug( __METHOD__ . ": $key still in use\n" );
$status->successCount++;
}
$dbw->commit();
$dbw->commit( __METHOD__ );
}
return $status;
}

View file

@ -38,7 +38,7 @@ abstract class RevDel_List extends RevisionListBase {
$this->res = false;
$dbw = wfGetDB( DB_MASTER );
$this->doQuery( $dbw );
$dbw->begin();
$dbw->begin( __METHOD__ );
$status = Status::newGood();
$missing = array_flip( $this->ids );
$this->clearFileOps();
@ -137,7 +137,7 @@ abstract class RevDel_List extends RevisionListBase {
'authorIds' => $authorIds,
'authorIPs' => $authorIPs
) );
$dbw->commit();
$dbw->commit( __METHOD__ );
// Clear caches
$status->merge( $this->doPostCommitUpdates() );

View file

@ -92,13 +92,13 @@ class MoveBatch extends Maintenance {
$this->output( $source->getPrefixedText() . ' --> ' . $dest->getPrefixedText() );
$dbw->begin();
$dbw->begin( __METHOD__ );
$err = $source->moveTo( $dest, false, $reason );
if ( $err !== true ) {
$msg = array_shift( $err[0] );
$this->output( "\nFAILED: " . wfMsg( $msg, $err[0] ) );
}
$dbw->commit();
$dbw->commit( __METHOD__ );
$this->output( "\n" );
if ( $interval ) {

View file

@ -293,7 +293,7 @@ class CompressOld extends Maintenance {
$chunk = new ConcatenatedGzipHistoryBlob();
$stubs = array();
$dbw->begin();
$dbw->begin( __METHOD__ );
$usedChunk = false;
$primaryOldid = $revs[$i]->rev_text_id;
@ -393,7 +393,7 @@ class CompressOld extends Maintenance {
}
# Done, next
$this->output( "/" );
$dbw->commit();
$dbw->commit( __METHOD__ );
$i += $thisChunkSize;
wfWaitForSlaves();
}