/**
* 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 );
* 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 ) );
/**
* Do any deferred updates and clear the list
*
- * @param string $commit set to 'commit' to commit after every update to
- * prevent lock contention
+ * @param string $commit Set to 'commit' to commit after every update to
+ * prevent lock contention
*/
public static function doUpdates( $commit = '' ) {
global $wgDeferredUpdateList;
// 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();