改名
This commit is contained in:
@@ -60,7 +60,7 @@ trait Message
|
|||||||
*/
|
*/
|
||||||
public function withCookie($name, $value = null, $expires = null, $path = null, $domain = null, $secure = null, $httponly = null, $samesite = null, $priority = null): static
|
public function withCookie($name, $value = null, $expires = null, $path = null, $domain = null, $secure = null, $httponly = null, $samesite = null, $priority = null): static
|
||||||
{
|
{
|
||||||
$this->cookies[$name] = [$value, $expires, $path, $domain, $secure, $httponly, $samesite, $priority];
|
$this->cookies[$name] = [$value, $expires, $path, $domain, $secure, $httponly, $samesite, $priority];
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,27 +74,27 @@ trait Message
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
#[Pure] public function getAccessControlAllowOrigin(): ?string
|
#[Pure] public function getAccessControlAllowOrigin(): ?string
|
||||||
{
|
{
|
||||||
return $this->getHeaderLine('Access-Control-Allow-Origin');
|
return $this->getHeaderLine('Access-Control-Allow-Origin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
#[Pure] public function getAccessControlAllowHeaders(): ?string
|
#[Pure] public function getAccessControlAllowHeaders(): ?string
|
||||||
{
|
{
|
||||||
return $this->getHeaderLine('Access-Control-Allow-Headers');
|
return $this->getHeaderLine('Access-Control-Allow-Headers');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
#[Pure] public function getAccessControlRequestMethod(): ?string
|
#[Pure] public function getAccessControlRequestMethod(): ?string
|
||||||
{
|
{
|
||||||
return $this->getHeaderLine('Access-Control-Request-Method');
|
return $this->getHeaderLine('Access-Control-Request-Method');
|
||||||
@@ -107,7 +107,7 @@ trait Message
|
|||||||
*/
|
*/
|
||||||
public function withProtocolVersion($version): static
|
public function withProtocolVersion($version): static
|
||||||
{
|
{
|
||||||
$this->version = $version;
|
$this->version = $version;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ trait Message
|
|||||||
if (!is_array($value)) {
|
if (!is_array($value)) {
|
||||||
$value = [$value];
|
$value = [$value];
|
||||||
}
|
}
|
||||||
$this->headers[$name] = $value;
|
$this->headers[$name] = $value;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +217,7 @@ trait Message
|
|||||||
if (!array_key_exists($name, $this->headers)) {
|
if (!array_key_exists($name, $this->headers)) {
|
||||||
throw new \Exception('Headers `' . $name . '` not exists.');
|
throw new \Exception('Headers `' . $name . '` not exists.');
|
||||||
}
|
}
|
||||||
$this->headers[$name][] = $value;
|
$this->headers[$name][] = $value;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ trait Message
|
|||||||
*/
|
*/
|
||||||
public function withBody(StreamInterface $body): static
|
public function withBody(StreamInterface $body): static
|
||||||
{
|
{
|
||||||
$this->stream = $body;
|
$this->stream = $body;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,10 +281,10 @@ trait Message
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $host
|
* @param $host
|
||||||
* @return \Server\Message\Request|\Server\Message\Response
|
* @return \Server\Message\Request|\Server\Message\Response
|
||||||
*/
|
*/
|
||||||
public function redirectTo($host)
|
public function redirectTo($host)
|
||||||
{
|
{
|
||||||
return $this->withHeader('Location', $host)
|
return $this->withHeader('Location', $host)
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ class Server extends HttpService
|
|||||||
foreach ($processes as $process) {
|
foreach ($processes as $process) {
|
||||||
$this->manager->addProcess($process);
|
$this->manager->addProcess($process);
|
||||||
}
|
}
|
||||||
Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION);
|
// Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_BLOCKING_FUNCTION);
|
||||||
|
|
||||||
return $this->manager->getServer()->start();
|
return $this->manager->getServer()->start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ class ServerManager
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws NotFindClassException
|
|
||||||
* @throws ReflectionException
|
* @throws ReflectionException
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
@@ -202,8 +201,8 @@ class ServerManager
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $key
|
* @param string $key
|
||||||
* @param $value
|
* @param string|int $value
|
||||||
*/
|
*/
|
||||||
public static function setEnv(string $key, string|int $value): void
|
public static function setEnv(string $key, string|int $value): void
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user