Skip to content

Commit

Permalink
FIX Don't use deprecated usage of get_class() (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Mar 19, 2024
1 parent bb0c48d commit 49cc581
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Filters/CachedContentFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@
*/
class CachedContentFilter extends ContentFilter
{

/**
* Enable caching
*
* @config
* @var boolean
*/
private static $cache_enabled = true;

public function getContent($key, $callback)
{
$cache = $this->getCache();

// Return cached value if available
$cacheEnabled = Config::inst()->get(get_class(), 'cache_enabled');
$cacheEnabled = Config::inst()->get(self::class, 'cache_enabled');
$result = (isset($_GET['flush']) || !$cacheEnabled)
? null
: $cache->get($key);
if ($result) {
return $result;
}

// Fallback to generate result
$result = parent::getContent($key, $callback);
$lifetime = Config::inst()->get(ContentFilter::class, 'cache_lifetime') ?: null;
Expand Down
4 changes: 2 additions & 2 deletions src/VersionFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function updateSettingsFields(FieldList $fields)

public function getSiteRSSLink()
{
if (Config::inst()->get(get_class(), 'allchanges_enabled')
if (Config::inst()->get(self::class, 'allchanges_enabled')
&& SiteConfig::current_site_config()->AllChangesEnabled
) {
return $this->owner->Link('allchanges');
Expand All @@ -215,7 +215,7 @@ public function getSiteRSSLink()

public function getDefaultRSSLink()
{
if (Config::inst()->get(get_class(), 'changes_enabled') && $this->owner->PublicHistory) {
if (Config::inst()->get(self::class, 'changes_enabled') && $this->owner->PublicHistory) {
return $this->owner->Link('changes');
}
}
Expand Down

0 comments on commit 49cc581

Please sign in to comment.