Commit 49cc581 1 parent bb0c48d commit 49cc581 Copy full SHA for 49cc581
File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
class CachedContentFilter extends ContentFilter
11
11
{
12
-
12
+
13
13
/**
14
14
* Enable caching
15
15
*
16
16
* @config
17
17
* @var boolean
18
18
*/
19
19
private static $ cache_enabled = true ;
20
-
20
+
21
21
public function getContent ($ key , $ callback )
22
22
{
23
23
$ cache = $ this ->getCache ();
24
-
24
+
25
25
// Return cached value if available
26
- $ cacheEnabled = Config::inst ()->get (get_class () , 'cache_enabled ' );
26
+ $ cacheEnabled = Config::inst ()->get (self ::class , 'cache_enabled ' );
27
27
$ result = (isset ($ _GET ['flush ' ]) || !$ cacheEnabled )
28
28
? null
29
29
: $ cache ->get ($ key );
30
30
if ($ result ) {
31
31
return $ result ;
32
32
}
33
-
33
+
34
34
// Fallback to generate result
35
35
$ result = parent ::getContent ($ key , $ callback );
36
36
$ lifetime = Config::inst ()->get (ContentFilter::class, 'cache_lifetime ' ) ?: null ;
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ public function updateSettingsFields(FieldList $fields)
206
206
207
207
public function getSiteRSSLink ()
208
208
{
209
- if (Config::inst ()->get (get_class () , 'allchanges_enabled ' )
209
+ if (Config::inst ()->get (self ::class , 'allchanges_enabled ' )
210
210
&& SiteConfig::current_site_config ()->AllChangesEnabled
211
211
) {
212
212
return $ this ->owner ->Link ('allchanges ' );
@@ -215,7 +215,7 @@ public function getSiteRSSLink()
215
215
216
216
public function getDefaultRSSLink ()
217
217
{
218
- if (Config::inst ()->get (get_class () , 'changes_enabled ' ) && $ this ->owner ->PublicHistory ) {
218
+ if (Config::inst ()->get (self ::class , 'changes_enabled ' ) && $ this ->owner ->PublicHistory ) {
219
219
return $ this ->owner ->Link ('changes ' );
220
220
}
221
221
}
You can’t perform that action at this time.
0 commit comments