We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29f8bf8 commit 00fc585Copy full SHA for 00fc585
1 file changed
system/Common.php
@@ -643,7 +643,13 @@ function helper($filenames)
643
*/
644
function is_cli(): bool
645
{
646
- return in_array(PHP_SAPI, ['cli', 'phpdbg'], true);
+ if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) {
647
+ return true;
648
+ }
649
+
650
+ // PHP_SAPI could be 'cgi-fcgi', 'fpm-fcgi'.
651
+ // See https://github.com/codeigniter4/CodeIgniter4/pull/5393
652
+ return ! isset($_SERVER['REMOTE_ADDR']) && ! isset($_SERVER['REQUEST_METHOD']);
653
}
654
655
0 commit comments