From: Mark A. Hershberger Date: Thu, 30 Apr 2015 02:23:30 +0000 (-0400) Subject: Create PageViewUpdates hook X-Git-Tag: 1.31.0-rc.0~11542 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Bar?a=commitdiff_plain;h=12c370c68b8bb2388be1829968e48d73f3b8d2e9;p=lhc%2Fweb%2Fwiklou.git Create PageViewUpdates hook Bug: T97622 Change-Id: I0f2dedf84a540b6f87623792c7b4f8b8ad8f8059 --- 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 );