update to 2.1.4 version

This commit is contained in:
jerry 2021-01-02 19:40:13 +08:00
parent c566f940e0
commit 557efc47a8
2 changed files with 9 additions and 6 deletions

View File

@ -3,7 +3,7 @@
"description": "High performance QQ robot and web server development framework",
"minimum-stability": "stable",
"license": "Apache-2.0",
"version": "2.1.3",
"version": "2.1.4",
"extra": {
"exclude_annotate": [
"src/ZM"

View File

@ -94,7 +94,8 @@ class Response
*/
public function status($http_code, $reason = null) {
$this->status_code = $http_code;
return $this->response->status($http_code, $reason);
if (!$this->is_end) return $this->response->status($http_code, $reason);
else return false;
}
public function getStatusCode() {
@ -107,7 +108,8 @@ class Response
* @return mixed
*/
public function setStatusCode($http_code, $reason = null) {
return $this->response->setStatusCode($http_code, $reason);
if (!$this->is_end) return $this->response->setStatusCode($http_code, $reason);
else return false;
}
/**
@ -117,7 +119,8 @@ class Response
* @return mixed
*/
public function header($key, $value, $ucwords = null) {
return $this->response->header($key, $value, $ucwords);
if (!$this->is_end) return $this->response->header($key, $value, $ucwords);
else return false;
}
/**
@ -127,7 +130,7 @@ class Response
* @return mixed
*/
public function setHeader($key, $value, $ucwords = null) {
return $this->response->setHeader($key, $value, $ucwords);
return !$this->is_end ? $this->response->setHeader($key, $value, $ucwords) : false;
}
/**
@ -165,7 +168,7 @@ class Response
public function isEnd() { return $this->is_end; }
public function endWithStatus($status_code = 200, $content = null){
public function endWithStatus($status_code = 200, $content = null) {
$this->status($status_code);
$this->end($content);
}