mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-06-18 18:51:47 +02:00
4d7641e16a
This patch depends on an update to the CMS module that provides this extension point. The code is inert when matched with existing CMS versions.
23 lines
639 B
PHP
23 lines
639 B
PHP
<?php
|
|
|
|
namespace SilverStripe\Subsites\Extensions;
|
|
|
|
use SilverStripe\CMS\Controllers\CMSMain;
|
|
use SilverStripe\Core\Extension;
|
|
use SilverStripe\Subsites\State\SubsiteState;
|
|
|
|
/**
|
|
* This extension adds the current Subsite ID as an additional factor to the Hints Cßache Key, which is used to cache
|
|
* the Site Tree Hints (which include allowed pagetypes).
|
|
*
|
|
* @package SilverStripe\Subsites\Extensions
|
|
* @see CMSMain::generateHintsCacheKey()
|
|
*/
|
|
class HintsCacheKeyExtension extends Extension
|
|
{
|
|
public function updateHintsCacheKey(&$baseKey)
|
|
{
|
|
$baseKey .= '_Subsite:' . SubsiteState::singleton()->getSubsiteId();
|
|
}
|
|
}
|