改进Request类的method方法

This commit is contained in:
thinkphp
2016-05-24 11:53:54 +08:00
parent 118800ed93
commit 38f343f69f

View File

@@ -410,8 +410,7 @@ class Request
*/
public function method()
{
$method = isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD'];
return IS_CLI ? 'GET' : $method;
return IS_CLI ? 'GET' : (isset($this->server['REQUEST_METHOD']) ? $this->server['REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']);
}
/**