@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | // NB. |
19 | 19 | // if the dataobject has the versioned extension then the cache should be invalidated onAfterPublish |
20 | 20 | // hasStages function is part of the Versioned class so safe to check here |
21 | - if (! $owner->hasExtension(Versioned::class)) { |
|
21 | + if (!$owner->hasExtension(Versioned::class)) { |
|
22 | 22 | $this->doUpdateCache($className); |
23 | - } elseif (! $owner->hasStages()) { |
|
23 | + } elseif (!$owner->hasStages()) { |
|
24 | 24 | $this->doUpdateCache($className); |
25 | 25 | } |
26 | 26 | } |
@@ -87,6 +87,6 @@ discard block |
||
87 | 87 | { |
88 | 88 | $excludedClasses = Config::inst()->get(self::class, 'excluded_classes'); |
89 | 89 | |
90 | - return ! in_array($className, $excludedClasses, true); |
|
90 | + return !in_array($className, $excludedClasses, true); |
|
91 | 91 | } |
92 | 92 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | self::$_can_cache_content_string = ''; |
29 | 29 | if ($this->owner->hasMethod('canCachePage')) { |
30 | 30 | self::$_can_cache_content_string = $this->owner->canCachePage() ? '' : 'can-no-cache-' . $this->owner->ID; |
31 | - if (! $this->canCacheCheck()) { |
|
31 | + if (!$this->canCacheCheck()) { |
|
32 | 32 | return false; |
33 | 33 | } |
34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $action = $this->owner->request->param('Action'); |
38 | 38 | if ($action) { |
39 | 39 | self::$_can_cache_content_string .= $action; |
40 | - if (! $this->canCacheCheck()) { |
|
40 | + if (!$this->canCacheCheck()) { |
|
41 | 41 | return false; |
42 | 42 | } |
43 | 43 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // id |
47 | 47 | if ($id) { |
48 | 48 | self::$_can_cache_content_string .= $id; |
49 | - if (! $this->canCacheCheck()) { |
|
49 | + if (!$this->canCacheCheck()) { |
|
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | self::$_can_cache_content_string .= $item; |
62 | 62 | } |
63 | 63 | |
64 | - if (! $this->canCacheCheck()) { |
|
64 | + if (!$this->canCacheCheck()) { |
|
65 | 65 | return false; |
66 | 66 | } |
67 | 67 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $member = Security::getCurrentUser(); |
72 | 72 | if ($member && $member->exists()) { |
73 | 73 | self::$_can_cache_content_string .= $member->ID; |
74 | - if (! $this->canCacheCheck()) { |
|
74 | + if (!$this->canCacheCheck()) { |
|
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | public function CacheKeyGenerator($letter, $includePageId = true): string |
132 | 132 | { |
133 | 133 | if ($this->HasCacheKeys()) { |
134 | - $string = $letter . '_' .$this->cacheKeyAnyDataObjectChanges(); |
|
134 | + $string = $letter . '_' . $this->cacheKeyAnyDataObjectChanges(); |
|
135 | 135 | |
136 | 136 | if ($includePageId) { |
137 | 137 | $string .= '_ID_' . $this->owner->ID; |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | public static function site_cache_key(): string |
37 | 37 | { |
38 | 38 | $obj = SiteConfig::current_site_config(); |
39 | - if($obj->HasCaching) { |
|
40 | - return (string) 'ts_'.strtotime($obj->CacheKeyLastEdited); |
|
39 | + if ($obj->HasCaching) { |
|
40 | + return (string) 'ts_' . strtotime($obj->CacheKeyLastEdited); |
|
41 | 41 | } else { |
42 | - return (string) 'ts_'.time(); |
|
42 | + return (string) 'ts_' . time(); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | UPDATE "SiteConfig" |
50 | 50 | SET |
51 | 51 | "CacheKeyLastEdited" = \'' . DBDatetime::now()->Rfc2822() . '\', |
52 | - "ClassNameLastEdited" = \'' . $className. '\' |
|
52 | + "ClassNameLastEdited" = \'' . $className . '\' |
|
53 | 53 | ;'); |
54 | 54 | } |
55 | 55 | } |