@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | // NB. |
| 20 | 20 | // if the dataobject has the versioned extension then the cache should be invalidated onAfterPublish |
| 21 | 21 | // hasStages function is part of the Versioned class so safe to check here |
| 22 | - if (! $owner->hasExtension(Versioned::class)) { |
|
| 22 | + if (!$owner->hasExtension(Versioned::class)) { |
|
| 23 | 23 | $this->doUpdateCache($className); |
| 24 | - } elseif (! $owner->hasStages()) { |
|
| 24 | + } elseif (!$owner->hasStages()) { |
|
| 25 | 25 | $this->doUpdateCache($className); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -93,6 +93,6 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | $excludedClasses = (array) Config::inst()->get(self::class, 'excluded_classes_for_caching'); |
| 95 | 95 | |
| 96 | - return ! in_array($className, $excludedClasses, true); |
|
| 96 | + return !in_array($className, $excludedClasses, true); |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | if ($obj->RecordCacheUpdates) { |
| 85 | 85 | $recordId = Injector::inst() |
| 86 | - ->create(ObjectsUpdated::class, ['ClassNameLastEdited' => $className]) |
|
| 86 | + ->create(ObjectsUpdated::class, [ 'ClassNameLastEdited' => $className ]) |
|
| 87 | 87 | ->write() |
| 88 | 88 | ; |
| 89 | 89 | DB::query('DELETE FROM ObjectsUpdated WHERE ID < ' . (int) ($recordId - self::MAX_OBJECTS_UPDATED)); |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | public function onBeforeInit() |
| 11 | 11 | { |
| 12 | 12 | $owner = $this->getOwner(); |
| 13 | - if($owner instanceof ContentController) { |
|
| 14 | - if(Versioned::get_stage() !== 'Live') { |
|
| 13 | + if ($owner instanceof ContentController) { |
|
| 14 | + if (Versioned::get_stage() !== 'Live') { |
|
| 15 | 15 | return; |
| 16 | 16 | } |
| 17 | - if(empty($owner->dataRecord) || empty($owner->dataRecord->PublicCacheDurationInSeconds)) { |
|
| 17 | + if (empty($owner->dataRecord) || empty($owner->dataRecord->PublicCacheDurationInSeconds)) { |
|
| 18 | 18 | return; |
| 19 | 19 | } |
| 20 | 20 | HTTPCacheControlMiddleware::singleton() |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | self::$_can_cache_content_string = ''; |
| 42 | 42 | if ($this->owner->hasMethod('canCachePage')) { |
| 43 | 43 | // if it can cache the page, then it the cache string will remain empty. |
| 44 | - self::$_can_cache_content_string .= $this->owner->canCachePage() ? '' : 'can-cache-page-no' . $this->owner->ID. '_'.time(); |
|
| 44 | + self::$_can_cache_content_string .= $this->owner->canCachePage() ? '' : 'can-cache-page-no' . $this->owner->ID . '_' . time(); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | //action |