From b2dd034d1be8cb20ae4066857ebe93383609c8b3 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 5 Jun 2024 16:36:26 +1200 Subject: [PATCH] ENH Use class name instead of self --- src/Filters/CachedContentFilter.php | 2 +- src/Filters/RateLimitFilter.php | 2 +- src/VersionFeed.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Filters/CachedContentFilter.php b/src/Filters/CachedContentFilter.php index 00fc8da..4d3b7ce 100644 --- a/src/Filters/CachedContentFilter.php +++ b/src/Filters/CachedContentFilter.php @@ -23,7 +23,7 @@ public function getContent($key, $callback) $cache = $this->getCache(); // Return cached value if available - $cacheEnabled = Config::inst()->get(self::class, 'cache_enabled'); + $cacheEnabled = Config::inst()->get(CachedContentFilter::class, 'cache_enabled'); $result = (isset($_GET['flush']) || !$cacheEnabled) ? null : $cache->get($key); diff --git a/src/Filters/RateLimitFilter.php b/src/Filters/RateLimitFilter.php index 02b3f56..e8ae7e7 100644 --- a/src/Filters/RateLimitFilter.php +++ b/src/Filters/RateLimitFilter.php @@ -64,7 +64,7 @@ class RateLimitFilter extends ContentFilter */ protected function getCacheKey($itemkey) { - $key = self::CACHE_PREFIX; + $key = RateLimitFilter::CACHE_PREFIX; // Add global identifier if ($this->config()->get('lock_bypage')) { diff --git a/src/VersionFeed.php b/src/VersionFeed.php index 312129a..acd2e89 100644 --- a/src/VersionFeed.php +++ b/src/VersionFeed.php @@ -206,7 +206,7 @@ public function updateSettingsFields(FieldList $fields) public function getSiteRSSLink() { - if (Config::inst()->get(self::class, 'allchanges_enabled') + if (Config::inst()->get(VersionFeed::class, 'allchanges_enabled') && SiteConfig::current_site_config()->AllChangesEnabled ) { return $this->owner->Link('allchanges'); @@ -215,7 +215,7 @@ public function getSiteRSSLink() public function getDefaultRSSLink() { - if (Config::inst()->get(self::class, 'changes_enabled') && $this->owner->PublicHistory) { + if (Config::inst()->get(VersionFeed::class, 'changes_enabled') && $this->owner->PublicHistory) { return $this->owner->Link('changes'); } }