1 bootstrap.inc backdrop_is_cli()

Detects whether the current script is running in a command-line environment.

File

core/includes/bootstrap.inc, line 4249
Functions that need to be loaded on every Backdrop request.

Code

function backdrop_is_cli() {
  return (empty($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
}