function CommandLineOrUnsafeMethod::isCli

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::isCli()
  2. 8.9.x core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::isCli()
  3. 10 core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php \Drupal\Core\PageCache\RequestPolicy\CommandLineOrUnsafeMethod::isCli()

Indicates whether this is a CLI request.

1 call to CommandLineOrUnsafeMethod::isCli()
CommandLineOrUnsafeMethod::check in core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php
Determines whether delivery of a cached page should be attempted.

File

core/lib/Drupal/Core/PageCache/RequestPolicy/CommandLineOrUnsafeMethod.php, line 29

Class

CommandLineOrUnsafeMethod
Reject when running from the command line or when HTTP method is not safe.

Namespace

Drupal\Core\PageCache\RequestPolicy

Code

protected function isCli() {
    return PHP_SAPI === 'cli';
}

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