Skip to content
Snippets Groups Projects
Commit a9a2ae1a authored by Angie Byron's avatar Angie Byron
Browse files

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

parent b1b69f72
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -2461,7 +2461,7 @@ function drupal_static_reset($name = NULL) {
* Detects whether the current script is running in a command-line environment.
*/
function drupal_is_cli() {
return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
return PHP_SAPI === 'cli';
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment