issue #107: previous fix caused all requests with "register_argc_argv" on to be detected as CLI.
This commit is contained in:
parent
1fe4c9a293
commit
eee14aea53
|
@ -516,12 +516,11 @@ function psm_POST($key, $alt = null) {
|
|||
/**
|
||||
* Check if we are in CLI mode
|
||||
*
|
||||
* Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli
|
||||
* source: https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_is_cli/7
|
||||
* Note, php_sapi cannot be used because cgi-fcgi returns both for web and cli.
|
||||
* @return boolean
|
||||
*/
|
||||
function psm_is_cli() {
|
||||
return (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0));
|
||||
return (!isset($_SERVER['SERVER_SOFTWARE']) || php_sapi_name() == 'cli');
|
||||
}
|
||||
|
||||
###############################################
|
||||
|
|
Loading…
Reference in New Issue