X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FCategoryPage.php;h=7dea27113dd52c15f31dc14d9bafa66bd290be6e;hb=08e0ed2b70ba5986a96c701f84a7679c98a6f2fd;hp=865471c33dc6b62812366b545633f1b1fcd908ab;hpb=9de4779e206628d8c7c9ae76785bfe825b5267d5;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/CategoryPage.php b/includes/page/CategoryPage.php index 865471c33d..7dea27113d 100644 --- a/includes/page/CategoryPage.php +++ b/includes/page/CategoryPage.php @@ -27,7 +27,7 @@ */ class CategoryPage extends Article { # Subclasses can change this to override the viewer class. - protected $mCategoryViewerClass = 'CategoryViewer'; + public $mCategoryViewerClass = 'CategoryViewer'; /** * @var WikiCategoryPage @@ -54,7 +54,10 @@ class CategoryPage extends Article { return; } - if ( !Hooks::run( 'CategoryPageView', [ &$this ] ) ) { + // Avoid PHP 7.1 warning of passing $this by reference + $categoryPage = $this; + + if ( !Hooks::run( 'CategoryPageView', [ &$categoryPage ] ) ) { return; } @@ -68,6 +71,10 @@ class CategoryPage extends Article { if ( $title->inNamespace( NS_CATEGORY ) ) { $this->closeShowCategory(); } + + # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often + $outputPage = $this->getContext()->getOutput(); + $outputPage->adaptCdnTTL( $this->mPage->getTouched(), IExpiringStore::TTL_MINUTE ); } function openShowCategory() {