From: Sam Reed Date: Fri, 24 Feb 2012 17:00:52 +0000 (+0000) Subject: More __METHOD__ into db related methods X-Git-Tag: 1.31.0-rc.0~24540 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=60081e9852f05aa037ed87df687deff0f5e81b0b;p=lhc%2Fweb%2Fwiklou.git More __METHOD__ into db related methods --- diff --git a/includes/Category.php b/includes/Category.php index 0be4830e97..4f1e423e7f 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -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; diff --git a/includes/FileDeleteForm.php b/includes/FileDeleteForm.php index 661edaa790..089acd03f3 100644 --- a/includes/FileDeleteForm.php +++ b/includes/FileDeleteForm.php @@ -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; } } diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index f607cd6524..c8677b7420 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -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; } diff --git a/includes/revisiondelete/RevisionDeleteAbstracts.php b/includes/revisiondelete/RevisionDeleteAbstracts.php index 36d5f647d7..c187a8c161 100644 --- a/includes/revisiondelete/RevisionDeleteAbstracts.php +++ b/includes/revisiondelete/RevisionDeleteAbstracts.php @@ -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() ); diff --git a/maintenance/moveBatch.php b/maintenance/moveBatch.php index 6ecc775e5a..a7739c2318 100644 --- a/maintenance/moveBatch.php +++ b/maintenance/moveBatch.php @@ -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 ) { diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index 8f0e92f98f..e166bc51b3 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -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(); }