X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FDeferredUpdates.php;h=a321414ae50c6476df74172eed2c3015486fd11c;hb=ae6e6edcca46dff2f367a782500f761c3ef0ac1d;hp=89c4df68f8df7966b7445836373cbe6d0d2c1e55;hpb=64797b281d1d8f3221aa61a00a36922b961f3922;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/DeferredUpdates.php b/includes/DeferredUpdates.php index 89c4df68f8..a321414ae5 100644 --- a/includes/DeferredUpdates.php +++ b/includes/DeferredUpdates.php @@ -63,6 +63,16 @@ class DeferredUpdates { self::addUpdate( new HTMLCacheUpdate( $title, $table ) ); } + /** + * Add a callable update. In a lot of cases, we just need a callback/closure, + * defining a new DeferrableUpdate object is not necessary + * @see MWCallableUpdate::__construct() + * @param callable $callable + */ + public static function addCallableUpdate( $callable ) { + self::addUpdate( new MWCallableUpdate( $callable ) ); + } + /** * Do any deferred updates and clear the list *