function KillSwitch::check

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php \Drupal\Core\PageCache\ResponsePolicy\KillSwitch::check()
  2. 10 core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php \Drupal\Core\PageCache\ResponsePolicy\KillSwitch::check()
  3. 11.x core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php \Drupal\Core\PageCache\ResponsePolicy\KillSwitch::check()

Overrides ResponsePolicyInterface::check

File

core/lib/Drupal/Core/PageCache/ResponsePolicy/KillSwitch.php, line 24

Class

KillSwitch
A policy evaluating to static::DENY when the kill switch was triggered.

Namespace

Drupal\Core\PageCache\ResponsePolicy

Code

public function check(Response $response, Request $request) {
    if ($this->kill) {
        return static::DENY;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.