Added
- #401 Optimized server and fixed middleware that user defined does not works.
- #402 Added Annotation
@AsyncQueueMessage
. - #418 Allows send WebSocket message to any
fd
in current server, even the worker process does not hold thefd
- #420 Added listener for model.
- #429 #643 Added validation component, a component similar to illuminate/validation.
- #441 Automatically close the spare redis client when it is used in low frequency.
- #478 Adopt opentracing interfaces and support Jaeger.
- #500 Added fluent method calls of
Hyperf\HttpServer\Contract\ResponseInterface
. - #523 Added option
table-mapping
for commanddb:model
. - #555 Added global function
swoole_hook_flags
to get the hook flags by constantSWOOLE_HOOK_FLAGS
, and you could define inbin/hyperf.php
via! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
to define the constant. - #596 #658 Added
required
parameter for@Inject
, if you define@Inject(required=false)
annotation to a property, therefore the DI container will not throw anHyperf\Di\Exception\NotFoundException
when the dependency of the property does not exists, the default value ofrequired
parameter istrue
. In constructor injection mode, you could define the default value of the parameter of the__construct
tonull
or define the parameter as anullable
parameter , this means this parameter is nullable and will not throw the exception too. - #597 Added concurrent for async-queue.
- #599 Allows set the retry seconds according to attempt times of async queue consumer.
- #619 Added HandlerStackFactory of guzzle.
- #620 Add automatic restart mechanism for consumer of async queue.
- #629 Allows to modify the
clientIp
,pullTimeout
,intervalTimeout
of Apollo client via config file. - #648 Added
nack
return type of AMQP consumer, the abstract consumer will executebasic_nack
method when the message handler return aHyperf\Amqp\Result::NACK
. - #654 Added all Swoole events and abstract hyperf events.
Changed
- #437 Changed
Hyperf\Testing\Client
handle exception handlers instead of throw an exception directly. - #463 Simplify
container.php
and improve annotation caching mechanism.
config/container.php
<?php
use Hyperf\Di\Container;
use Hyperf\Di\Definition\DefinitionSourceFactory;
use Hyperf\Utils\ApplicationContext;
$container = new Container((new DefinitionSourceFactory(true))());
if (! $container instanceof \Psr\Container\ContainerInterface) {
throw new RuntimeException('The dependency injection container is invalid.');
}
return ApplicationContext::setContainer($container);
- #486 Changed
getParsedBody
of Request is available to return JSON formatted data normally. - #523 The command
db:model
will generate the singular class name of an plural table as default. - #614 #617 Changed the structure of config provider, also moved
config/dependencies.php
toconfig/autoload/dependencies.php
, also you could placedependencies
into config/config.php.
Changed the structure of config provider:
Before:
'scan' => [
'paths' => [
__DIR__,
],
'collectors' => [],
],
Now:
'annotations' => [
'scan' => [
'paths' => [
__DIR__,
],
'collectors' => [],
],
],
- #630 Changed the way to instantiate
Hyperf\HttpServer\CoreMiddleware
, usemake()
instead ofnew
. - #631 Changed the way to instantiate AMQP Consumer, use
make()
instead ofnew
. - #637 Changed the argument 1 of
Hyperf\Contract\OnMessageInterface
andHyperf\Contract\OnOpenInterface
, useSwoole\WebSocket\Server
instead ofSwoole\Server
. - #638 Renamed command
db:model
togen:model
and added rewrite connection name visitor.
Deleted
- #401 Deleted class
Hyperf\JsonRpc\HttpServerFactory
,Hyperf\HttpServer\ServerFactory
,Hyperf\GrpcServer\ServerFactory
. - #402 Deleted deprecated method
AsyncQueue::delay
. - #563 Deleted deprecated constants
Hyperf\Server\ServerInterface::SERVER_TCP
, useHyperf\Server\ServerInterface::SERVER_BASE
to instead of it. - #602 Removed timeout property of
Hyperf\Utils\Coroutine\Concurrent
. - #612 Deleted useless
$url
for RingPHP Handlers. - #616 #618 Deleted useless code of guzzle.
Optimized
- #644 Optimized annotation scan process, separate to two scan parts
app
andvendor
, greatly decrease the elapsed time. - #653 Optimized the detect logical of swoole shortname.
Fixed
- #448 Fixed TCP Server does not works when HTTP Server or WebSocket Server exists.
- #623 Fixed the argument value will be replaced by default value when pass a
null
to the method of proxy class. - #647 Append
eof
to TCP response, according to the server configuration.
Fixed
- #636 Fixed http client with pool handler may be used by different coroutine at the same time.