github hyperf/hyperf v1.1.0

latest releases: v3.1.21, v3.1.20, v3.1.19...
4 years ago

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 the fd
  • #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 command db:model.
  • #555 Added global function swoole_hook_flags to get the hook flags by constant SWOOLE_HOOK_FLAGS, and you could define in bin/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 an Hyperf\Di\Exception\NotFoundException when the dependency of the property does not exists, the default value of required parameter is true. In constructor injection mode, you could define the default value of the parameter of the __construct to null or define the parameter as a nullable 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 execute basic_nack method when the message handler return a Hyperf\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 to config/autoload/dependencies.php, also you could place dependencies 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, use make() instead of new.
  • #631 Changed the way to instantiate AMQP Consumer, use make() instead of new.
  • #637 Changed the argument 1 of Hyperf\Contract\OnMessageInterface and Hyperf\Contract\OnOpenInterface, use Swoole\WebSocket\Server instead of Swoole\Server.
  • #638 Renamed command db:model to gen: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, use Hyperf\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 and vendor, 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.

Don't miss a new hyperf release

NewReleases is sending notifications on new releases.