drupal_is_cli
- Versions
- 7
drupal_is_cli()
Detect whether the current script is running in a command-line environment.
Code
includes/bootstrap.inc, line 2246
<?php
function drupal_is_cli() {
return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
}
?>Login or register to post comments 