KillSwitch.php in Drupal 10
File
core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php
View source
<?php
namespace Drupal\Core\PageCache\ResponsePolicy;
use Drupal\Core\PageCache\ResponsePolicyInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class KillSwitch implements ResponsePolicyInterface {
protected $kill = FALSE;
public function check(Response $response, Request $request) {
if ($this->kill) {
return static::DENY;
}
}
public function trigger() {
$this->kill = TRUE;
}
}
Classes
Name |
Description |
KillSwitch |
A policy evaluating to static::DENY when the kill switch was triggered. |