mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-09 01:35:35 +08:00
add context() fetch data mode
enable coroutine override
This commit is contained in:
@@ -21,6 +21,7 @@ class Response
|
||||
*/
|
||||
private $response;
|
||||
private $is_end = false;
|
||||
private $status_code;
|
||||
|
||||
public function __construct(\Swoole\Http\Response $response) {
|
||||
$this->response = $response;
|
||||
@@ -90,9 +91,14 @@ class Response
|
||||
* @return mixed
|
||||
*/
|
||||
public function status($http_code, $reason = null) {
|
||||
$this->status_code = $http_code;
|
||||
return $this->response->status($http_code, $reason);
|
||||
}
|
||||
|
||||
public function getStatusCode() {
|
||||
return $this->status_code ?? 200;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $http_code
|
||||
* @param $reason
|
||||
|
||||
Reference in New Issue
Block a user