Skip to content

Commit 5fb638f

Browse files
authored
Merge pull request #1 from Flowpack/task/addEnabledSetting
TASK Add `enabled` setting
2 parents 386cdc4 + 69aba60 commit 5fb638f

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

Classes/Http/RequestInterceptorComponent.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,21 @@ class RequestInterceptorComponent implements ComponentInterface
1919
*/
2020
protected $cacheFrontend;
2121

22+
/**
23+
* @var boolean
24+
* @Flow\InjectConfiguration(path="enabled")
25+
*/
26+
protected $enabled;
27+
2228
/**
2329
* @inheritDoc
2430
*/
2531
public function handle(ComponentContext $componentContext)
2632
{
33+
if (!$this->enabled) {
34+
return;
35+
}
36+
2737
$request = $componentContext->getHttpRequest();
2838
if (strtoupper($request->getMethod()) !== 'GET') {
2939
return;

Classes/Http/RequestStorageComponent.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ class RequestStorageComponent implements ComponentInterface
1919
*/
2020
protected $cacheFrontend;
2121

22+
/**
23+
* @var boolean
24+
* @Flow\InjectConfiguration(path="enabled")
25+
*/
26+
protected $enabled;
27+
2228
/**
2329
* @Flow\Inject
2430
* @var ContentCacheAspect
@@ -30,6 +36,10 @@ class RequestStorageComponent implements ComponentInterface
3036
*/
3137
public function handle(ComponentContext $componentContext)
3238
{
39+
if (!$this->enabled) {
40+
return;
41+
}
42+
3343
$request = $componentContext->getHttpRequest();
3444
if (strtoupper($request->getMethod()) !== 'GET') {
3545
return;

Configuration/Settings.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Flowpack:
2+
FullPageCache:
3+
enabled: true
14
Neos:
25
Flow:
36
http:

0 commit comments

Comments
 (0)