/** * Hook entry when article is purged (purge the gallery cache if purging the category page */ public static function onArticlePurge(WikiPage $page) { $title = $page->getTitle(); $ns = $title->getNamespace(); if ($ns == NS_CATEGORY) { // Invalidate category service and (by hooks) category gallery cache CategoryService::invalidateTopArticles($title, NS_MAIN); } return true; }