Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 7 Dec 2010 15:47:34 +0000 (15:47 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Tue, 7 Dec 2010 15:47:34 +0000 (15:47 +0000)
includes/GlobalFunctions.php
includes/Wiki.php

index e9c8b85..c6d0ec7 100644 (file)
@@ -2860,9 +2860,10 @@ function wfMakeUrlIndex( $url ) {
 /**
  * Do any deferred updates and clear the list
  *
- * @param $commit Boolean: commit after every update to prevent lock contention
+ * @param $commit String: set to 'commit' to commit after every update to
+ *                prevent lock contention
  */
-function wfDoUpdates( $commit = false ) {
+function wfDoUpdates( $commit = '' ) {
        global $wgDeferredUpdateList;
 
        wfProfileIn( __METHOD__ );
@@ -2873,14 +2874,15 @@ function wfDoUpdates( $commit = false ) {
                return;
        }
 
-       if ( $commit ) {
+       $doCommit = $commit == 'commit';
+       if ( $doCommit ) {
                $dbw = wfGetDB( DB_MASTER );
        }
 
        foreach ( $wgDeferredUpdateList as $update ) {
                $update->doUpdate();
 
-               if ( $commit && $dbw->trxLevel() ) {
+               if ( $doCommit && $dbw->trxLevel() ) {
                        $dbw->commit();
                }
        }
index 7440423..3b21a93 100644 (file)
@@ -371,7 +371,7 @@ class MediaWiki {
                // Output everything!
                $output->output();
                // Do any deferred jobs
-               wfDoUpdates( true );
+               wfDoUpdates( 'commit' );
                // Close the session so that jobs don't access the current session
                session_write_close();
                $this->doJobs();