Browse Source

Update laravel/request.php

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.
David Lin 12 years ago
parent
commit
5929f8e537
1 changed files with 2 additions and 2 deletions
  1. 2 2
      laravel/request.php

+ 2 - 2
laravel/request.php

@@ -196,7 +196,7 @@ class Request {
 	 */
 	 */
 	public static function cli()
 	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 @@ class Request {
 		return call_user_func_array(array(static::foundation(), $method), $parameters);
 		return call_user_func_array(array(static::foundation(), $method), $parameters);
 	}
 	}
 
 
-}
+}