From: Alexandre Emsenhuber Date: Tue, 7 Dec 2010 15:47:34 +0000 (+0000) Subject: Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability X-Git-Tag: 1.31.0-rc.0~33478 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=1f9be9ead2d27d12a167c0968d61fdda764cb617;p=lhc%2Fweb%2Fwiklou.git Per Nikerabbit, follow-up to r77972: use a string instead of boolean for readability --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index e9c8b858e2..c6d0ec7baa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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(); } } diff --git a/includes/Wiki.php b/includes/Wiki.php index 7440423a24..3b21a93430 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -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();