We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76ad2ad commit 29f8bf8Copy full SHA for 29f8bf8
1 file changed
system/Common.php
@@ -643,16 +643,7 @@ function helper($filenames)
643
*/
644
function is_cli(): bool
645
{
646
- if (defined('STDIN')) {
647
- return true;
648
- }
649
-
650
- if (! isset($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']) && isset($_SERVER['argv']) && count($_SERVER['argv']) > 0) {
651
652
653
654
- // if source of request is from CLI, the `$_SERVER` array will not populate this key
655
- return ! isset($_SERVER['REQUEST_METHOD']);
+ return in_array(PHP_SAPI, ['cli', 'phpdbg'], true);
656
}
657
658
0 commit comments