MediaWiki  REL1_22
CallableUpdate.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class MWCallableUpdate implements DeferrableUpdate {
00007 
00011     private $callback;
00012 
00016     public function __construct( $callback ) {
00017         if ( !is_callable( $callback ) ) {
00018             throw new MWException( 'Not a valid callback/closure!' );
00019         }
00020         $this->callback = $callback;
00021     }
00022 
00026     public function doUpdate() {
00027         call_user_func( $this->callback );
00028     }
00029 
00030 }