Fix CLI mode detection for some shared hosts.
@@ -213,7 +213,7 @@ if (isset($environment))
|
*/
-if (defined('STDIN'))
+if (Request::cli())
{
$console = CLI\Command::options($_SERVER['argv']);
@@ -196,7 +196,7 @@ class Request {
public static function cli()
- return defined('STDIN');
+ return defined('STDIN') || (substr(PHP_SAPI, 0, 3) == 'cgi' && getenv('TERM'));
}
/**