You are here

protected function RestfulAuthenticationCookie::isCli in RESTful 7

Detects whether the script is running from a command line environment.

Return value

bool TRUE if a command line environment is detected. FALSE otherwise.

1 call to RestfulAuthenticationCookie::isCli()
RestfulAuthenticationCookie::authenticate in plugins/authentication/RestfulAuthenticationCookie.class.php
Implements RestfulAuthenticationInterface::authenticate().

File

plugins/authentication/RestfulAuthenticationCookie.class.php, line 44
Contains RestfulAuthenticationCookie.

Class

RestfulAuthenticationCookie
@file Contains RestfulAuthenticationCookie.

Code

protected function isCli() {

  // Needed to detect if run-tests.sh is running the tests.
  $cli = \RestfulManager::getRequestHttpHeader('User-Agent') == 'Drupal command line';
  return $cli || drupal_is_cli();
}