From d1bbc15e297aefc02747dd3ed86ece5f138ee4e4 Mon Sep 17 00:00:00 2001 From: bsitu Date: Mon, 31 Dec 2012 14:30:32 -0800 Subject: [PATCH] Add new hook LinksUpdateAfterInsert to LinksUpdate This will allow extensions to do some work based on the links inserted Change-Id: Ia522de65ff17e28c6a8cd9997cf6225100fefc9e --- docs/hooks.txt | 10 ++++++++-- includes/LinksUpdate.php | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index f1034a66bd..abf1b8038d 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1353,8 +1353,14 @@ $linkType: The external link type actual update &$linksUpdate: the LinksUpdate object -'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating has -completed +'LinksUpdateAfterInsert': At the end of LinksUpdate::incrTableUpdate() after +each link table insert. For example, pagelinks, imagelinks, externallinks. +$linksUpdate: LinksUpdate object +$table: the table to insert links to +$insertions: an arry of links to insert + +'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating, +including delete and insert, has completed for all link tables &$linksUpdate: the LinksUpdate object 'LinksUpdateConstructed': At the end of LinksUpdate() is contruction. diff --git a/includes/LinksUpdate.php b/includes/LinksUpdate.php index 7ddf8638f9..cfd7413a6e 100644 --- a/includes/LinksUpdate.php +++ b/includes/LinksUpdate.php @@ -342,6 +342,7 @@ class LinksUpdate extends SqlDataUpdate { } if ( count( $insertions ) ) { $this->mDb->insert( $table, $insertions, __METHOD__, 'IGNORE' ); + wfRunHooks( 'LinksUpdateAfterInsert', array( $this, $table, $insertions ) ); } } -- 2.20.1