X-Git-Url: http://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2FLinksUpdate.php;h=0b7393addbbb9a0dde8bb91a0818e65f099e3318;hb=0d7a30fa27ebaefb5d89693bbe658916b982c082;hp=8c6d762341c3c3ea76190c2f894d312e195ab02e;hpb=2525ceb3cdc1b1c50526ea128af3677fed2049b4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 8c6d762341..0b7393addb 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -27,7 +27,7 @@ */ class LinksUpdate extends SqlDataUpdate { - // @todo: make members protected, but make sure extensions don't break + // @todo make members protected, but make sure extensions don't break public $mId, //!< Page ID of the article linked from $mTitle, //!< Title object of the article linked from @@ -237,22 +237,36 @@ class LinksUpdate extends SqlDataUpdate { wfProfileOut( __METHOD__ ); } + /** + * Queue recursive jobs for this page + * + * Which means do LinksUpdate on all templates + * that include the current page, using the job queue. + */ function queueRecursiveJobs() { - wfProfileIn( __METHOD__ ); + self::queueRecursiveJobsForTable( $this->mTitle, 'templatelinks' ); + } - if ( $this->mTitle->getBacklinkCache()->hasLinks( 'templatelinks' ) ) { + /** + * Queue a RefreshLinks job for any table. + * + * @param Title $title Title to do job for + * @param String $table Table to use (e.g. 'templatelinks') + */ + public static function queueRecursiveJobsForTable( Title $title, $table ) { + wfProfileIn( __METHOD__ ); + if ( $title->getBacklinkCache()->hasLinks( $table ) ) { $job = new RefreshLinksJob2( - $this->mTitle, + $title, array( - 'table' => 'templatelinks', + 'table' => $table, ) + Job::newRootJobParams( // "overall" refresh links job info - "refreshlinks:templatelinks:{$this->mTitle->getPrefixedText()}" + "refreshlinks:{$table}:{$title->getPrefixedText()}" ) ); JobQueueGroup::singleton()->push( $job ); JobQueueGroup::singleton()->deduplicateRootJob( $job ); } - wfProfileOut( __METHOD__ ); }