More __METHOD__ into db related methods
authorSam Reed <reedy@users.mediawiki.org>
Fri, 24 Feb 2012 17:00:52 +0000 (17:00 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 24 Feb 2012 17:00:52 +0000 (17:00 +0000)
includes/Category.php
includes/FileDeleteForm.php
includes/filerepo/LocalRepo.php
includes/revisiondelete/RevisionDeleteAbstracts.php
maintenance/moveBatch.php
maintenance/storage/compressOld.php

index 0be4830..4f1e423 100644 (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;
index 661edaa..089acd0 100644 (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;
                        }
                }
index f607cd6..c8677b7 100644 (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;
        }
index 36d5f64..c187a8c 100644 (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() );
index 6ecc775..a7739c2 100644 (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 ) {
index 8f0e92f..e166bc5 100644 (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();
                        }