From: bsitu Date: Mon, 31 Dec 2012 22:30:32 +0000 (-0800) Subject: Add new hook LinksUpdateAfterInsert to LinksUpdate X-Git-Tag: 1.31.0-rc.0~21168^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=d1bbc15e297aefc02747dd3ed86ece5f138ee4e4;p=lhc%2Fweb%2Fwiklou.git Add new hook LinksUpdateAfterInsert to LinksUpdate This will allow extensions to do some work based on the links inserted Change-Id: Ia522de65ff17e28c6a8cd9997cf6225100fefc9e --- 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 ) ); } }