From 12c370c68b8bb2388be1829968e48d73f3b8d2e9 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 29 Apr 2015 22:23:30 -0400 Subject: [PATCH] Create PageViewUpdates hook Bug: T97622 Change-Id: I0f2dedf84a540b6f87623792c7b4f8b8ad8f8059 --- docs/hooks.txt | 6 ++++++ includes/page/WikiPage.php | 1 + 2 files changed, 7 insertions(+) diff --git a/docs/hooks.txt b/docs/hooks.txt index 6f59b2d3a7..6e003632fd 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2125,6 +2125,12 @@ the key. &$confstr: reference to a hash key string which can be modified $user: User (object) requesting the page +'PageViewUpdate': Allow database (or other) changes to be made after a +page view is seen by MediaWiki. Note this does not capture views made +via external caches such as Squid. +$wikipage: WikiPage (object) for the page being viewed. +$user: User (object) for the user who is viewing. + 'ParserAfterParse': Called from Parser::parse() just after the call to Parser::internalParse() returns. $parser: parser object diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 752565da15..e938ca84bc 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1141,6 +1141,7 @@ class WikiPage implements Page, IDBAccessObject { return; } + Hooks::run( 'PageViewUpdates', array( $this, $user ) ); // Update newtalk / watchlist notification status try { $user->clearNotification( $this->mTitle, $oldid ); -- 2.20.1