X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FDeferredUpdates.php;h=5cf0d2be6eb1d5770d0c4d09705379127f060b5a;hb=ba6017b2d3ce3a8b92403c4fb5b8fcb023ca6d2d;hp=c385f138e96cff30d21c11897b015d2ce730e1cb;hpb=12ddd4d9a2341d217789fc2137422a69f2a948f8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/DeferredUpdates.php b/includes/deferred/DeferredUpdates.php index c385f138e9..5cf0d2be6e 100644 --- a/includes/deferred/DeferredUpdates.php +++ b/includes/deferred/DeferredUpdates.php @@ -46,7 +46,7 @@ class DeferredUpdates { /** * Add an update to the deferred list - * @param $update DeferrableUpdate Some object that implements doUpdate() + * @param DeferrableUpdate $update Some object that implements doUpdate() */ public static function addUpdate( DeferrableUpdate $update ) { array_push( self::$updates, $update ); @@ -56,8 +56,8 @@ class DeferredUpdates { * HTMLCacheUpdates are the most common deferred update people use. This * is a shortcut method for that. * @see HTMLCacheUpdate::__construct() - * @param $title - * @param $table + * @param Title $title + * @param string $table */ public static function addHTMLCacheUpdate( $title, $table ) { self::addUpdate( new HTMLCacheUpdate( $title, $table ) ); @@ -77,7 +77,7 @@ class DeferredUpdates { * Do any deferred updates and clear the list * * @param string $commit set to 'commit' to commit after every update to - * prevent lock contention + * prevent lock contention */ public static function doUpdates( $commit = '' ) { global $wgDeferredUpdateList; @@ -89,14 +89,17 @@ class DeferredUpdates { // No need to get master connections in case of empty updates array if ( !count( $updates ) ) { wfProfileOut( __METHOD__ ); + return; } + $dbw = false; $doCommit = $commit == 'commit'; if ( $doCommit ) { $dbw = wfGetDB( DB_MASTER ); } + /** @var DeferrableUpdate $update */ foreach ( $updates as $update ) { try { $update->doUpdate();