From d051994e2c717d63f4af6074a94763ea5e525d30 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 12 Sep 2012 14:56:46 +0300 Subject: [PATCH 1/2] Fix CLI mode detection for some shared hosts. --- laravel/request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/request.php b/laravel/request.php index e78c943d..53744367 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -196,7 +196,7 @@ public static function time() */ public static function cli() { - return defined('STDIN'); + return defined('STDIN') || (substr(PHP_SAPI, 0, 3) == 'cgi' && getenv('TERM')); } /** From b1e4cf9d299377005722a23ccd874f33094493f4 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 17 Sep 2012 18:42:25 +0300 Subject: [PATCH 2/2] Use Request helper to determine whether we're in CLI mode. --- laravel/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/laravel/core.php b/laravel/core.php index 0f33ccfd..a2170611 100644 --- a/laravel/core.php +++ b/laravel/core.php @@ -213,7 +213,7 @@ | */ -if (defined('STDIN')) +if (Request::cli()) { $console = CLI\Command::options($_SERVER['argv']);