
| Current Path : /var/www/html/rocksensor/web/core/lib/Drupal/Core/PageCache/ResponsePolicy/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor/web/core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php |
<?php
namespace Drupal\Core\PageCache\ResponsePolicy;
use Drupal\Core\PageCache\ResponsePolicyInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* A policy evaluating to static::DENY when the kill switch was triggered.
*/
class KillSwitch implements ResponsePolicyInterface {
/**
* A flag indicating whether the kill switch was triggered.
*
* @var bool
*/
protected $kill = FALSE;
/**
* {@inheritdoc}
*/
public function check(Response $response, Request $request) {
if ($this->kill) {
return static::DENY;
}
}
/**
* Deny any page caching on the current request.
*/
public function trigger() {
$this->kill = TRUE;
}
}