Commit a9a2ae1a authored by webchick's avatar webchick

Issue #2206263 by sun: Drupal_is_cli() returns FALSE on PHP CLI.

parent b1b69f72
...@@ -2461,7 +2461,7 @@ function drupal_static_reset($name = NULL) { ...@@ -2461,7 +2461,7 @@ function drupal_static_reset($name = NULL) {
* Detects whether the current script is running in a command-line environment. * Detects whether the current script is running in a command-line environment.
*/ */
function drupal_is_cli() { function drupal_is_cli() {
return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0))); return PHP_SAPI === 'cli';
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment