You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP parser支持chunked编码(Http\Parser->isChunked():boolHttp\Parser->getCurrentChunkLength(): int 方法等)
添加文档注释和注解供静态分析器使用
新增 Coroutine::registerDeadlockHandler(callable $callable): Util\Handler API
新增 Socket->getSimpleType(): intSocket->getSimpleTypeName(): stringSocket::typeSimplify(int $type): intSocket::typeName(int $type): stringSocket->getId(): int API
新增 Http\Server\Connection->recvHttpRequestTo(Request $request): RequestHttp\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame API
新增 Http\MimeTypeStream\Psr7Stream 类
完善socket选项的支持
添加Http\Message->detectContentLength(): int API
添加Object\DupTrait 特质
添加Http\Uri::from(UriInterface|string $uri): static API
Implemented serverParams and cookieParams for PSR style $_SERVER usage
HTTP parser now supports multipart file upload (Http\Parser->isMultipart(): bool method Http\UploadFileHttp\RawUploadFile class array Http\RawResult->$uploadedFiles e.t.c)
HTTP parser now supports chunked encoding (Http\Parser->isChunked():boolHttp\Parser->getCurrentChunkLength(): int e.t.c)
Added many in-code documents and annotations for statically analizing
Added Coroutine::registerDeadlockHandler(callable $callable): Util\Handler API
Added Socket->getSimpleType(): intSocket->getSimpleTypeName(): stringSocket::typeSimplify(int $type): intSocket::typeName(int $type): stringSocket->getId(): int API
Added Http\Server\Connection->recvHttpRequestTo(Request $request): RequestHttp\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame API
Added Http\MimeTypeStream\Psr7Stream classes
Added more socket options support
Added ConnectionManagerTrait->getConnections(): array API
Added more mime type constants
Added Http\Message->detectContentLength(): int API
Added Object\DupTrait trait
Added Http\Uri::from(UriInterface|string $uri): static API
Added Coroutine->isExecuting(): bool API
Remove Http\Server\Connection->setServer(), refactor Http\Server\Connection constructor to __construct(Server $server)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
开发进展记录
TL;DR
主要变化:
Closure
的序列化支持proc_open
Major changes:
Closure
serialization supportproc_open
hook修复
Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization
(Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization #104)Coroutine::getCurrent
,Coroutine::getMain
Coroutine::getPrevious
Buffer->copy
函数签名Socket->sendTo
Socket->writeTo
Socket->sendStringTo
参数类型声明Coroutine->setLocalVar()
中的内存错误Coroutine::getExecutedFunctionName()
方法setUri(UriInterface $uri, ?bool $preserveHost = null): static
方法签名增加 删除 修改
proc_open
的hookHttp\Parser->isMultipart(): bool
方法Http\UploadFile
Http\RawUploadFile
类array Http\RawResult->$uploadedFiles
属性等)Http\Parser->isChunked():bool
Http\Parser->getCurrentChunkLength(): int
方法等)Coroutine::registerDeadlockHandler(callable $callable): Util\Handler
APISocket->getSimpleType(): int
Socket->getSimpleTypeName(): string
Socket::typeSimplify(int $type): int
Socket::typeName(int $type): string
Socket->getId(): int
APIHttp\Server\Connection->recvHttpRequestTo(Request $request): Request
Http\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame
APIHttp\MimeType
Stream\Psr7Stream
类Http\Message->detectContentLength(): int
APIObject\DupTrait
特质Http\Uri::from(UriInterface|string $uri): static
APICoroutine->isExecuting(): bool
APIHttp\Server\Connection->setServer()
,修改Http\Server\Connection
构造符为__construct(Server $server)
Http\Message->getBodyAsString()
Buffer->copy()
Errno
类中Swow
类中Yyyy\Xxxx\Exception
->Yyyy\XxxxException
(Some Renames #108)$capacity = -1
现在表示不限制channel的容量Socket->accept()
为Socket->accept(?int $timeout = null)
和Socket->acceptTo(Socket $connection, ?int $timeout = null)
Http\Server->acceptConnection
签名为Http\Server->acceptConnection(?int $timeout = null, ?Connection $connection = null)
Signal::wait()
函数签名为Socket::wait(int $num, int $timeout = -1)
($timeout
默认值为不超时)Socket->accept()
函数签名为Socket->accept(?Socket $connection = null, ?int $timeout = null)
(参数名修改)Util\copyDir
->Util\touchDir
{Http\Status, Websocket\Opcode, WebSocket\Status}::{getName, getReasonPhrase, getDescription} -> {getNameFor, getReasonPhraseFor, getDescriptionFor}
Http\TypeInterface
->Http\ProtocolTypeInterface
Http\RawResult->{$isUpgrade, $uploadedFiles} -> Http\RawRequest->{$isUpgrade, $uploadedFiles}
Coroutine->call()
签名为Coroutine->call(callable $callable, int $level = 0)
(添加$level
参数)Swow\WebSocket
中的命名空间常量为Swow\WebSocket
类常量\Http\BodyParser
类Socket::__construct(int $type)
(移除了默认值)WaitReference::wait(self &$ref, int $timeout = -1): void
(修改参数名称)Channel::OPCODE_*
为Channel\Selector::EVENT_*
Socket->enableCrypto(?array $options = null)
中设置tls选项(记录随时变更)
Fix
Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization
(Typed property Swow\Http\ServerRequest::$parsedBody must not be accessed before initialization #104)Coroutine::getCurrent
,Coroutine::getMain
Coroutine::getPrevious
Buffer->copy
functions signatureSocket->sendTo
Socket->writeTo
Socket->sendStringTo
arguments type hintCoroutine->setLocalVar()
memory corruptionCoroutine::getExecutedFunctionName()
method namesetUri(UriInterface $uri, ?bool $preserveHost = null): static
method signatureAddition Removal Change
proc_open
hookHttp\Parser->isMultipart(): bool
methodHttp\UploadFile
Http\RawUploadFile
classarray Http\RawResult->$uploadedFiles
e.t.c)Http\Parser->isChunked():bool
Http\Parser->getCurrentChunkLength(): int
e.t.c)Coroutine::registerDeadlockHandler(callable $callable): Util\Handler
APISocket->getSimpleType(): int
Socket->getSimpleTypeName(): string
Socket::typeSimplify(int $type): int
Socket::typeName(int $type): string
Socket->getId(): int
APIHttp\Server\Connection->recvHttpRequestTo(Request $request): Request
Http\WebSocketTrait->recvWebSocketFrameTo(WebSocketFrame $frame): WebSocketFrame
APIHttp\MimeType
Stream\Psr7Stream
classesConnectionManagerTrait->getConnections(): array
APIHttp\Message->detectContentLength(): int
APIObject\DupTrait
traitHttp\Uri::from(UriInterface|string $uri): static
APICoroutine->isExecuting(): bool
APIHttp\Server\Connection->setServer()
, refactorHttp\Server\Connection
constructor to__construct(Server $server)
Http\Message->getBodyAsString()
Buffer->copy()
Errno
final classSwow
final classYyyy\Xxxx\Exception
toYyyy\XxxxException
(Some Renames #108)$capacity = -1
indicates unlimited capacity for ChannelSocket->accept()
intoSocket->accept(?int $timeout = null)
andSocket->acceptTo(Socket $connection, ?int $timeout = null)
Http\Server->acceptConnection
toHttp\Server->acceptConnection(?int $timeout = null, ?Connection $connection = null)
Signal::wait()
toSocket::wait(int $num, int $timeout = -1)
($timeout
now have a -1 default value for no time limit)Socket->accept()
signature toSocket->accept(?Socket $connection = null, ?int $timeout = null)
(argument name changes)Util\copyDir
->Util\touchDir
{Http\Status, Websocket\Opcode, WebSocket\Status}::{getName, getReasonPhrase, getDescription} -> {getNameFor, getReasonPhraseFor, getDescriptionFor}
Http\TypeInterface
->Http\ProtocolTypeInterface
Http\RawResult->{$isUpgrade, $uploadedFiles} -> Http\RawRequest->{$isUpgrade, $uploadedFiles}
Coroutine->call()
signature toCoroutine->call(callable $callable, int $level = 0)
(add$level
param)Swow\WebSocket
toSwow\WebSocket
class constant\Http\BodyParser
classSocket::__construct(int $type)
(removed default value)WaitReference::wait(self &$ref, int $timeout = -1): void
(argument name changes)Channel::OPCODE_*
toChannel\Selector::EVENT_*
Socket->enableCrypto(?array $options = null)
(this may change at anytime)
Beta Was this translation helpful? Give feedback.
All reactions