@@ -31,8 +31,6 @@ define('WORKERMAN_SEND_FAIL', 2);
define('OS_TYPE_LINUX', 'linux');
define('OS_TYPE_WINDOWS', 'windows');
-define('NO_CLI', PHP_SAPI !== 'cli');
-
// Compatible with php7
if(!class_exists('Error'))
{
@@ -722,3 +722,5 @@ class HttpCache
}
HttpCache::init();
+
+define('NO_CLI', PHP_SAPI !== 'cli');
@@ -542,7 +542,7 @@ class Worker
protected static function checkSapiEnv()
// Only for cli.
- if (NO_CLI) {
+ if (PHP_SAPI !== 'cli') {
exit("Only run in command line mode \n");
if (DIRECTORY_SEPARATOR === '\\') {