- #3047 Fixed bug that renew sid in all namespaces failed.
- #3087 Fixed memory leak when using pipeline sometimes.
- #3015 Added a mechanism to clean up garbage sid automatically for
socketio-server. - #3030 Added method
ProceedingJoinPoint::getInstance()to get instance which will be called byAOP.
- #3011 Optimized
hyperf/tracerwhich will log and tag exception in a span.
- #2978 Fixed bug that
hyperf/snowflakeis broken due to missinghyperf/contract. - #2983 Fixed swoole hook flags does works for co server.
- #2993 Fixed
Arr::merge()does not works when$array1is empty.
- #2872 Added
hyperf/pharcomponent.
- #2952 Fixed bug that nacos config center does not works in coroutine server.
- #2934 Changed config file
scout.phpwhich search engine index is used as the model index name by default. - #2958 Added NoneEngine as the default engine of view config.
- #2951 Optimized code for model-cache, which will delete model cache only once, when using it in transaction.
- #2953 Hide
Swoole\ExitExceptiontrace message in command. - #2963 Removed
onStartevent from server default callbacks when the mode isSWOOLE_BASE.
- #2896 Support to define autoloaded view component classes and anonymous components.
- #2921 Added method
count()forParallel.
- #2913 Fixed memory leak when using
with()for ORM. - #2915 Fixed bug that worker will be stoped when
onMessageoronClosefailed in websocket server. - #2927 Fixed validation rule
alpha_dashdoes not supportint.
- #2918 Don't allow to open
server.settings.daemonizeconfiguration when usinghyperf/watcher. - #2930 Upgrade the minimum version of
php-amqplibtov2.9.2.
- #2931 Pass controller instance as first argument to method_exists function not the class namespace string.
- #2857 Support Consul ACL Token for Service Governance.
- #2870 The publish option of
ConfigProviderallows publish directory. - #2875 Added option
no-restartfor watcher. - #2883 Added options
--chunkand--column|cinto commandscout:import. - #2891 Added config file for crontab.
- #2874 Fixed
scan.ignore_annotationsdoes not works when using watcher. - #2878 Fixed config of nsqd does not works.
- #2851 Changed default engine of view config.
- #2785 Optimized code for watcher.
- #2861 Optimized guzzle coroutine handler which throw exception when the status code below zero.
- #2868 Optimized code for guzzle sink, which support resource not only string.
- #2824 Added method
simplePaginate()which returnPaginatorInterfaceinHyperf\Database\Query\Builder.
- #2820 Fixed amqp consumer does not works when using fanout exchange.
- #2831 Fixed bug that amqp connection always be closed by client.
- #2848 Fixed database connection has already been bound to another coroutine when used in defer.
- #2824 Changed the result from
PaginatorInterfacetoLengthAwarePaginatorInterfacefor methodpaginate()inHyperf\Database\Query\Builder.
- #2766 Safely finish spans in case of exception for tracer.
- #2805 Optimized nacos process which can stop safely.
- #2821 Optimized the exceptions thrown by
JsonandXml. - #2827 Optimized
Hyperf\Server\ServerConfigwhich return type of__setshould be void. - #2839 Optimized comments for
Hyperf\Database\Schema\ColumnDefinition.
- #2794 #2802 Added
options.cookie_lifetimeforhyperf/session, you can use it to control the expire time for cookies.
- #2783 Fixed nsq consumer does not works in coroutine style server.
- #2788 Fixed call non-static method
__handlePropertyHandler()statically in class proxy. - #2790 Fixed
BootProcessListenerofconfig-etcddoes not works in coroutine style server. - #2803 Fixed response body does not exists when bad request.
- #2807 Fixed Middleware does not work as expected when repeatedly configured.
- #2750 Use elastic
indexinstead oftypeforsearchableAs, when the config ofindexisnullor the elastic version is more than7.0.0.
- #2752 Support route
optionsfor@AutoController@Controllerand@Mapping.
- #2768 Fixed memory leak when websocket hande shake failed.
- #2777 Fixed
$authdoes not supportnullfor low version ofext-redis. - #2779 Fixed server start failed, when don't publish config of translation.
- #2765 Use
Hyperf\Utils\Coroutine::create()instead ofSwoole\Coroutine::create()forConcurrent.
- #2347 You can set
$waitTimeoutforConsumerMessageto stop amqp consumer safely in coroutine style server.
- #2625 Added aspect
Hyperf\Tracer\Aspect\JsonRpcAspectwhich support json-rpc for tracer component. - #2709 #2733 Added
@mixininto Model, you can use static methods friendly. - #2726 #2733 Added option
--with-idewhich used to generate ide file. - #2737 Added view-engine component.
- #2719 Fixed method
Arr::mergedoes not works whenarray1does not constains the$key. - #2723 Fixed
Paginator::resolveCurrentPathdeos not works.
- #2746 Only execute task in the worker process.
- #2728 The methods with prefix
__will not be registered into service forrpc-server.
- #2682 Added method
getCacheTTLforCacheableInterfacewhich can control cache time each models. - #2696 Added swoole tracker leak tool.
- #2680 Fixed Type error for
CastsValue, because$isSynchronizeddon't have default value. - #2680 Fixed default value in
$itemswill be replaced by__constructforCastsValue. - #2693 Fixed unexpected behavior in retry budget for
hyperf/retry. - #2695 Fixed method
Container::define()does not works when the class has been resolved.
- #2611 Optimized
FindDriverfor watcher, you can use it in alpine image. - #2662 Optimized amqp consumer which can stop safely.
- #2690 Optimized
tracerwhich ensure span finished and flushed.
- #2654 Added method
Hyperf\Utils\Resource::fromwhich can convertstringtoresource.
- #2634 #2640 Fixed bug that
RedisSecondMetaGeneratorwill generate the same meta. - #2639 Fixed exception will not be normalized for json-rpc.
- #2643 Fixed undefined method unsearchable for
scout:flush.
- #2656 Optimized the response when parse parameters failed for json-rpc.
- #1172 Added
hyperf/scout, a coroutine friendly version oflaravel/scout. - #1868 Added sentinel mode for redis.
- #1969 Added
hyperf/resourceandhyperf/resource-grpcwhich can format model to response easily.
- #2594 Fixed crontab does not stops when using signal.
- #2601 Fixed
@propertywill be replaced by@property-readwhen the property hasgetterandsetterat the same time. - #2607 #2637 Fixed memory leak in
RetryAnnotationAspect. - #2624 Fixed http client does not works when using guzzle 7.0 and curl hook for
hyperf/testing. - #2632 #2635 Fixed redis cluster does not support password.
- #2603 Allow
whereNullto accept array columns argument.
- #2445 Added trace info for
WhoopsExceptionHandlerwhen the headeracceptisapplication/json. - #2580 Support metadata for grpc client side.
- #2559 Fixed the event does not works which caused by connecting with
queryfor socketio-server. - #2565 Fixed proxy class generate keyword
parent::classbut the class scope has on parent. - #2578 Fixed event
AfterProcessHandlewon't be dispatched when throw exception in process. - #2582 Fixed redis connection has already been bound to another coroutine.
- #2589 Fixed amqp consumer does not starts when using coroutine style server.
- #2590 Fixed crontab does not works when using coroutine style server.
- #2561 Optimized error message when close amqp connection failed.
- #2584 Don't delete nacos service when server shutdown.
- #2512 Added
column_typeforMySqlGrammar::compileColumnListing.
- #2490 Fixed streaming grpc-client does not works.
- #2509 Fixed mutated attributes do not work in camel case for
hyperf/database. - #2535 Fixed
@propertyof mutated attribute will be replaced by morphTo forgen:model. - #2546 Fixed db connection don't destruct when using left join.
- #2490 Optimized exception and test cases for grpc-client.
- #2455 Added method
Socket::getRequestto retrieve psr7 request from socket for socketio-server. - #2459 Added
ReloadChannelListenerto reload timeout or failed channels automatically for async-queue. - #2463 Added optional visitor
ModelRewriteGetterSetterVisitorforgen:model. - #2475 Added
throwbaleto the end of arguments of fallback forretrycomponent.
- #2464 Fixed method
filldoes not works for camel case model. - #2478 Fixed
Sender::checkdoes not works when the checked fd not belong to websocket. - #2488 Fixed
beginTransactionfailed when the pdo isnull.
- #2461 Optimized the http route observer which you can observe any one not only
httpforreactive-x. - #2465 Optimized the fallback of
FallbackRetryPolicywhich supportclass@method, the class will be get from Container.
- #2492 Adjust event sequence to ensure sid is added to room for socketio-server.
- #2411 Added method
Hyperf\Database\Query\Builder::forPageBeforeIdfor database. - #2420 #2426 Added option
enable-event-dispatcherto initialize EventDispatcher for command. - #2433 Added support for gRPC Server routing definition by anonymous functions.
- #2441 Added some setters for
SocketIO.
- #2427 Fixed model event dispatcher does not works for
PivotandMorphPivot. - #2443 Fixed traceid does not exists when using coroutine handler.
- #2449 Fixed apollo config file name error.
- #2429 Optimized error message when does not set the value of
@varfor@Inject. - #2438 #2452 Optimized code for deleting model cache when model deleted or saved in transaction.
- #2331 Added auth api for hyperf/nacos component.
- #2331 Added config
nacos.enableto control the hyperf/nacos component. - #2331 Added array merge mode for hyperf/nacos component.
- #2377 Added
tsheader for gRPC request of client, compatible with Node.js gRPC server etc. - #2384 Added global function
optional()to createHyperf\Utils\Optionalobject or for more convenient way to use.
- #2331 Fixed exception thrown when the service or config was not found for hyperf/nacos component.
- #2356 #2368 Fixed
server:startfailed, when the config of pid_file changed. - #2358 Fixed validation rule
digitsdoes not supportint.
- #2359 Optimized custom process which stop friendly when running in coroutine server.
- #2363 Optimized hyperf/di component which is no need to depend on hyperf/config component.
- #2373 Optimized the exception handler which add
content-typeheader automatically by default for hyperf/validation component.
- #2334 Added method
Arr::mergeto merge array more friendly thanarray_merge_recursive. - #2335 Added
Hyperf/Utils/Optionalwhich accepts any argument and allows you to access properties or call methods on that object. - #2336 Added
RedisNsqAdapterwhich publish message through nsq forsocketio-server.
- #2338 Fixed filesystem does not works when using s3 adapter.
- #2340 Fixed
__FUNCTION__and__METHOD__magic constants does work in closure of aop proxy class
- #2319 Optimized the
ResolverDispatcherwhich is friendly for circular dependencies.
- Upgraded
markrogoyski/math-phprequirement from^0.49.0to^1.2.0
- #2307 #2312 Added NSQD HTTP API client support for hyperf/nsq component.
- #2275 Fixed bug that fetch process blocking for config center.
- #2276 Fixed bug that the config is cleared when the config is not modified in apollo.
- #2280 Fixed bug that interface methods will be rewriten by aop.
- #2281 Fixed
co::createfailed in non-coroutine environment forhyperf/signal. - #2304 Fixed dead cycle when del sid for socketio memory adapter.
- #2309 Fixed JsonRpcHttpTransporter cannot set the custom timeout property.
- #2125 Added Jet component, Jet is a unification model RPC Client, built-in JSONRPC protocol, available to running in ALL PHP environments, including PHP-FPM and Swoole/Hyperf environments.
- #2236 Fixed bug that select node failed when using
loadBalancerfor nacos. - #2242 Fixed bug that collect more than once time when using watcher.
- #2210 Fixed bug that open event won't be executed after handshake right now.
- #2214 Fixed bug that close event won't be executed when close the connection by websocket server.
- #2218 Fixed bug that sender does not works for coroutine server.
- #2227 Fixed context won't be destroyed when accept keepalive connection for co server.
- #2193 Optimized the scan accuracy for
Hyperf\Watcher\Driver\FindDriver. - #2232 Optimized eager load when the type is
InorInRawfor model-cache.
- #2144 Added filed
$resultforQueryExecuted. - #2158 Added route options to route handler.
- #2162 Added
Hyperf\Watcher\Driver\FindDriverforhyperf/watcher. - #2169 Added
session.options.domainforhyperf/sessionto change the domain which get from request. - #2174 Added
ModelRewriteTimestampsVisitorto rewrite$timestampsbased oncreated_atandupdated_atfor Model. - #2175 Added
ModelRewriteSoftDeletesVisitorto insert or removeSoftDeletesbased ondeleted_atfor Model. - #2176 Added
ModelRewriteKeyInfoVisitorto rewrite$incrementing$primaryKeyand$keyTypefor Model.
- #2149 Fixed bug that custom processes cannot fetch config from nacos.
- #2159 Fixed fatal exception caused by exist file when using
gen:migration.
- #2043 Throw an exception when none of the scan directories exists.
- #2182 Don't record the close message when the server is not websocket server.
- #1554 Added
hyperf/nacoscomponent. - #2082 Added
SIGINTlistened byHyperf\Signal\Handler\WorkerStopHandler. - #2097 Added TencentCloud COS for
hyperf/filesystem. - #2122 Added
\Hyperf\Snowflake\Concern\HasSnowflakeTrait to integratehyperf/snowflakeand database models.
- #2017 Fixed when prometheus using the redis record, an error is reported during the rendering of data due to the change in the number of label.
- #2117 Fixed
@Injectwill be useless sometimes when usingserver:watch. - #2123 Fixed bug that
redis::callwill be recorded twice. - #2139 Fixed bug that
ValidationMiddlewarewill throw exception in websocket. - #2140 Fixed a case where session are not saved when exception occurs.
- #2080 Optimized the type of
$perPagefromintto?intfor methodHyperf\Database\Model\Builder::paginate. - #2110 Don't kill
SIGTERMif the process not exists forhyperf/watcher. - #2116 Optimized requirement for
hyperf/di. - #2121 Replaced the default
@propertyif user redeclare it when usinggen:model. - #2129 Optimized the exception message when the response json encoding failed.
- #2018 Make prometheus use redis to store data to support cluster mode
- #1898 Fixed crontab rule
$min-$maxparsing errors. - #2037 Fixed bug that tcp server running in only one coroutine.
- #2051 Fixed
hyperf.pidwon't be created in coroutine server. - #2055 Fixed guzzle auto add
Expect: 100-Continueheader when put a large file. - #2059 Fixed redis reconnection bug in socket.io server.
- #2067 Fixed bug that syntax parse error will cause worker exceptions for
hyperf/watcher. - #2085 Fixed bug in RetryFalsy Annotation that leads to retrying truthy results.
- #2089 Fixed class of command won't be loaded after
gen:command. - #2093 Fixed type error for command
vendor:publish.
- #1860 Added
OnWorkerExitcallback by default for server. - #2042 Added
ScanFileDriverto watch file changes forhyperf/watcher. - #2054 Added eager load relation for model-cache.
- #2049 Optimized stdout when server restart for
hyperf/watcher. - #2090 Adapte original response object for
hyperf/session.
- #2031 The code of constants only support
intandstring. - #2065 Changed
Hyperf\WebSocketServer\Senderwhich only supportpushanddisconnect. - #2100 Upgrade
doctrine/inflectorto^2.0forhyperf/utils.
- #2065 Removed methods
sendsendtoandclosefromHyperf\WebSocketServer\Sender.
- #1952 Fixed bug that migration will be created although class already exists.
- #1960 Fixed
Hyperf\HttpServer\ResponseEmitter::isMethodsExists()method does not works as expected. - #1961 Fixed start failed when
config/autoload/aspects.phpdoes not exists. - #1964 Fixed http status code 500 caused by empty body.
- #1965 Fixed the wrong http code when
initRequestAndResponsefailed. - #1968 Fixed aspect does not work as expected after
aspects.phpis edited. - #1985 Fixed global_imports do not work when the aliases are not all lowercase letters.
- #1990 Fixed
@Injectdoes not work when the parent class has the same property. - #2019 Fixed bug that
gen:modelgenerate property failed, when usedmorphToorwhere. - #2026 Fixed invalid lazy proxy generation when magic methods are used.
- #1986 Changed exit_code
0toSIGTERMwhen swoole short name do not set disable.
- Refactor hyperf/di component, in particular, AOP and Annotation Scanner are optimized, in v2.0, the component use a brand new loading mechanism to provided an incredible AOP function.
- The most significant functional differences compared to v1.x is that you can cut into any classes in any ways with Aspect. For example, in v1.x, you can only use AOP in the class instance that created by Hyperf DI container, you cannot cut into the class instance that created by
newidentifier. But now, in v2.0, it is available. But there is still has an exception, the classes that used in bootstrap stage still cannot works. - In v1.x, the AOP ONLY available for the normal classes, not for Final class that cannot be inherited by a subclass. But now, in v2.0. it is available.
- In v1.x, you cannot use the property value that marked by
@Injector@Valueannotation in the constructor of current class. But now, in v2.0, it is available. - In v1.x, you can only use
@Injectand@Valueannotation in the class instance that created by Hyperf DI container. But now, in v2.0, it is available in any ways, such as the class instance that created bynewidentifier. - In v1.x, you have to define the full namespace of Annotation class when you use the Annotation. But now, in v2.0, the component provide a global import mechanism, you cloud define an alias for Annotation to use the Annotation directly without using the namespace. For example, you cloud define
@Injectannotation in any class without defineuse Hyperf\Di\Annotation\Inject;. - In v1.x, the proxy class that created by the DI container is a subclass of the target class, this mechanism will cause the magic constant will return the value of proxy class but not original class, such as
__CLASS__. But now, in v2.0, the proxy class will keep the same structure with the original class, will not change the class name or the class structure. - In v1.x, the proxy class will not re-generate when the proxy file exists even the code of the proxy class changed, this strategy will improve the time-consuming of scan, but at the same time, this will lead to a certain degree of development inconvenience. And now, in v2.0, the file cache of proxy class will generated according to the code content of the proxy class, this changes will reduces the mental burden of development.
- Add
priorityparameter for Aspect, now you could definepriorityin Aspect class by class property or annotation property, to manage the order of the aspects. - In v1.x, you can only define an Aspect class by
@Aspectannotation, you cannot define the Aspect class by configuration file. But now, in v2.0, it is available to define the Aspect class by configuration file or ConfigProvider. - In v1.x, you have to add
Hyperf\Di\Listener\LazyLoaderBootApplicationListenerto enable lazy loading. In 2.0, lazy loading can be used directly. This listener is therefore removed. - Added
annotations.scan.class_mapconfiguration, now you could replace any content of class dynamically above the autoload rules.
- The most significant functional differences compared to v1.x is that you can cut into any classes in any ways with Aspect. For example, in v1.x, you can only use AOP in the class instance that created by Hyperf DI container, you cannot cut into the class instance that created by
- Upgraded
ext-swooleto>=4.5; - Upgraded
psr/event-dispatcherto^1.0; - Upgraded
monolog/monologto^2.0; - Upgraded
phpstan/phpstanto^0.12.18; - Upgraded
vlucas/phpdotenvto^4.0; - Upgraded
symfony/finderto^5.0; - Upgraded
symfony/event-dispatcherto^5.0; - Upgraded
symfony/consoleto^5.0; - Upgraded
symfony/property-accessto^5.0; - Upgraded
symfony/serializerto^5.0; - Upgraded
elasticsearch/elasticsearchto^7.0;
- Removed
Hyperf\Di\Aop\AstCollector; - Removed
Hyperf\Di\Aop\ProxyClassNameVisitor; - Removed
Hyperf\Di\Listener\LazyLoaderBootApplicationListener - Removed method
dispatch(...$params)fromHyperf\Dispatcher\AbstractDispatcher - Removed mapping for
Hyperf\Contract\NormalizerInterface => Hyperf\Utils\Serializer\SymfonyNormalizerfromConfigProviderin utils. - Removed the typehint of
$serverparameter ofHyperf\Contract\OnOpenInterface、Hyperf\Contract\OnCloseInterface、Hyperf\Contract\OnMessageInterface、Hyperf\Contract\OnReceiveInterface;
-
#992 Added ReactiveX component.
-
#1245 Added Annotation
ExceptionHandler. -
#1245 Exception handler's config and annotation support priority.
-
#1819 Added
hyperf/signalcomponent. -
#1844 Support type
\DateIntervalforttlinmodel-cache. -
#1855 Added
ConstantFrequencyto flush one connection, when it is idle connection for the interval of time. -
#1871 Added
sinkfor guzzle. -
#1805 Added Coroutine Server.
- Changed method
bind(Server $server)tobind($server)inHyperf\Contract\ProcessInterface. - Changed method
isEnable()toisEnable($server)inHyperf\Contract\ProcessInterface - Process mode of config-center, crontab, metric, comsumers of MQ can not running in coroutine server.
- Change the life-cycle of
Hyperf\AsyncQueue\Environment, can only applies in the current coroutine, not the whole current process. - Coroutine Server does not support task mechanism.
- Changed method
-
#1877 Support to use typehint of property on PHP 8 to replace
@varwhen using@Injectannotation, for example:
class Example {
/**
* @Inject
*/
private ExampleService $exampleService;
}
- #1890 Added
Hyperf\HttpServer\ResponseEmitterclass to emit any PSR-7 response object with Swoole server, and extractedHyperf\Contract\ResponseEmitterInterface. - #1890 Added
getTrailers()andgetTrailer(string $key)andwithTrailer(string $key, $value)methods forHyperf\HttpMessage\Server\Response. - #1920 Added method
Hyperf\WebSocketServer\Sender::close(int $fd, bool $reset = null).
- #1825 Fixed
TypeErrorforStartServer::execute. - #1854 Fixed
is_resourcedoes not works when useRuntime::enableCoroutine()privately in filesystem. - #1900 Fixed caster decimal of Model does not work.
- #1917 Fixed
Request::isXmlHttpRequestdoes not work.
- #705 Uniformed the handling of HTTP exceptions, now unified throwing a
Hyperf\HttpMessage\Exception\HttpExceptionexception class to replace the way of direct response inDispatcher, also provided anHyperf\HttpServer\Exception\Handler\ httptionHandlerExceptionHandler to handle these HTTP Exception; - #1846 Don't auto change the impl for
Hyperf\Contract\NormalizerInterfacewhen you requiresymfony/serialize. You can added dependiencies below to use symfony serializer.
use Hyperf\Utils\Serializer\SerializerFactory;
use Hyperf\Utils\Serializer\Serializer;
return [
Hyperf\Contract\NormalizerInterface::class => new SerializerFactory(Serializer::class),
];- #1924 Changed
Hyperf\GrpcClient\BaseClientmethodssimpleRequest, getGrpcClient, clientStreamRequestto_simpleRequest, _getGrpcClient, _clientStreamRequest.
- #1890 Removed
Hyperf\Contract\Sendableinterface and all implementations of it. - #1905 Removed config
config/server.php, you can merge it intoconfig/config.php.
- #1793 Socket.io server now only dispatch connect/disconnect events in onOpen and onClose. Also upgrade some class members from private to protected, so users can hack them.
- #1848 Auto generate rpc client code when server start and the interface is changed.
- #1863 Support async-queue stop safely.
- #1896 Keys will be merged when different constants use the same code.