From 5929f8e537779a211c829654afe46ad9d8eaecae Mon Sep 17 00:00:00 2001 From: David Lin Date: Wed, 27 Feb 2013 08:54:57 +0800 Subject: [PATCH] Update laravel/request.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running nginx with php-cgi (Fast-CGI):  spawn-fcgi -a 127.0.0.1 -p 10081 -C 50 -u nobody -f /usr/local/php5317/bin/php-cgi The Request::cli() method will determine the web request as run from the command line. Add ` PHP_SAPI != "cgi-fcgi" ` to resolve it. --- laravel/request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/laravel/request.php b/laravel/request.php index 0193776e..7cf85d69 100644 --- a/laravel/request.php +++ b/laravel/request.php @@ -196,7 +196,7 @@ public static function time() */ public static function cli() { - return defined('STDIN') || (substr(PHP_SAPI, 0, 3) == 'cgi' && getenv('TERM')); + return defined('STDIN') || (PHP_SAPI != "cgi-fcgi" && substr(PHP_SAPI, 0, 3) == 'cgi' && getenv('TERM')); } /** @@ -287,4 +287,4 @@ public static function __callStatic($method, $parameters) return call_user_func_array(array(static::foundation(), $method), $parameters); } -} \ No newline at end of file +}