protected function CookieAuthentication::isCli in RESTful 7.2
Detects whether the script is running from a command line environment.
Parameters
RequestInterface $request.: The request.
Return value
bool TRUE if a command line environment is detected. FALSE otherwise.
1 call to CookieAuthentication::isCli()
- CookieAuthentication::authenticate in src/
Plugin/ authentication/ CookieAuthentication.php - Authenticate the request by trying to match a user.
File
- src/
Plugin/ authentication/ CookieAuthentication.php, line 66 - Contains \Drupal\restful\Plugin\authentication\CookieAuthentication
Class
- CookieAuthentication
- Class CookieAuthentication @package Drupal\restful\Plugin\authentication
Namespace
Drupal\restful\Plugin\authenticationCode
protected function isCli(RequestInterface $request) {
// Needed to detect if run-tests.sh is running the tests.
$cli = $request
->getHeaders()
->get('User-Agent')
->getValueString() == 'Drupal command line';
return $cli || drupal_is_cli();
}