docs/en/changelog/3.0.md
Premature end of data into DetectsLostConnections.? but without query.tracer.Hyperf\Crontab\Mutex\ServerNodeInterface to get unique name for server node.rate_limit.storage.options.pool which can be used to select the pool of redis when using rate-limit.Executor class.grpc request lifecycle support.Validator::setValue and make Validator::getValue public.Arr::flatten, which is faster than before.metric.enable_command_metric switch.serverName parameter to Hyperf\HttpServer\Router\Dispatched.class_parents returning false in class_uses_recursive.$delivery_info and optimize BeforeConsume event.hyperf/translation classes to use typed properties.isNotFound method for Dispatched.AfterExecute event of hyperf/command.Str::replaceLast with empty search cannot work as expected.RpcAspect and use it instead of JsonRpcAspect.ElasticserachAspect and CoroutineAspect.Hyperf\Tracer\Aspect\GrpcAspect.exception_callback option for hyperf/kafka.cleanUpExpiredOnce failed when sids is empty when using socketio-server.hyperf/codec to support subclass rewriting.replaceStart isJson.json_validate to validate is json if function is available.trace.services.enable.register is false.crontab cannot not work well when the crontab executed more than one hour (the default expired time).RequestTraceListener for hyperf/tracer.ignore_exceptions for hyperf/tracer.FailToConsume event for hyperf/kafka.validateJson cannot work when using php 8.0.ConstantFrequency cannot work when using redis.nacos grpc client.getThrowable method to request events and crontab event.ExcludeIf File ImageFile and ProhibitedIf.sendSync and sendBatchAsync methods for Hyperf\Kafka\Producer.kafka reporter for hyperf/tracer.HttpClientFactory for hyperf/tracer.describe:routes command, sort middleware by MiddlewareManager$server property to request events.php_serialize protocol for hyperf/rpc-multilex.hyperf/tracer.Hyperf\Support\Composer::hasPackage() method.Context::override and Context::getOrSet cannot work when using $coroutineId.#[Hyperf\Constants\Annotation\Constants].no_aspect is overridden.Arr::has with integer keys cannot work as expected.Trace-Id to Response Header.Hyperf\Coroutine\Traits\Container as deprecated.GuzzleHttp\Client::request().Str::contains will cause the error result when the $needles is [null].Str::startsWith and Str::endsWith will cause the error result when the $needles is [null].Str::containsIgnoreCase() which determine if a given string contains a given substring regardless of case sensitivity.SameSite support to session cookies.access_key and access_secret for nacos service governance.Hyperf\Codec\Packer\IgbinarySerializerPacker.http2-client cannot be closed when didn't open heartbeat.nacos grpc client cannot be closed friendly when worker exit.ApplicationContext cannot be found when using grpc-client.client::$servers must be accessed before initialization.Integer and Boolean.NacosClientFactory which will create nacos client instead of nacos application.clickhouse for hyperf/db.CoroutineMemory::clearPrefix() cannot work as expected.chunkById but the column is not existed.Hyperf\Database\Model\Builder::value() cannot work when using column like table.column.__FILE__ and __DIR__ cannot be rewritten successfully in proxy classes.hyperf/http-server cannot match psr7.le、lte、gt、gte do not support comparison between numeric and string values.psr/http-message.build_sql which be used in QueryException.Hyperf\Command\Annotation\Command, support set properties for command.Zipkin\Propagation\Map.hyperf/translation.Hyperf\Coordinator\Timer::until().Hyperf\DB\MySQLConnection.Hyperf\Metric\Adapter\Prometheus\Redis which allowed to rewrite the prefix about redis keys.exception property to Request Lifecycle Events.Swoole 5 PgSQL for hyperf/db.Swoole 4 PgSQL for hyperf/db.Arr::hasAny().view-engine.metric and added some unit cases.Hyperf\Metric\Listener\OnPipeMessage to avoid message block.Hyperf\Config\config function.Arr::mapWithKeys().$timeout in #[Task] don't match TaskAspect.rpc-multiplex.Model::resolveRelationUsing() which you can set dynamic relation for model.hyperf/utils from hyperf/rpc.Hyperf\Coroutine\Coroutine::sleep() instead of Swoole\Coroutine::sleep().hyperf/support.pgsql-swoole cannot throw exceptions when statement execution failed.hyperf/codec from hyperf/utils.hyperf/serializer from hyperf/utils.Packers to hyperf/codec.hyperf/support from hyperf/utils.hyperf/code-parser from hyperf/utils.Hyperf\Coroutine\Channel\Pool instead of Hyperf\Utils\ChannelPool.classes and functions of Hyperf\Utils.find many to get non-exists models.Model::findManyFromCache().Hyperf\Stringable\str() helper function.Redis::pipeline() and Redis::transaction() support.model-cache.PriorityDefinition to sort dependencies.Hyperf\Stringable\Str instead of Hyperf\Utils\Str.hyperf/utils from hyperf/guzzle.Hyperf\Context\Context::destroy method.ApplicationContext from hyperf/utils to hyperf/context.hyperf/guzzle from hyperf/consul.hyperf/coroutine from hyperf/utils.Hyperf\Context\ApplicationContext instead of Hyperf\Utils\ApplicationContext.CoroutineProxy from hyperf/utils to hyperf/context.Hyperf\Coroutine\Coroutine instead of Hyperf\Utils\Coroutine.hyperf/utils to hyperf/coroutine.Hyperf\Utils\Arr that let it extends Hyperf\Collection\Arr.server.options.send_channel_capacity to control whether to use safe socket.Hyperf\Collection\Collection instead of Hyperf\Utils\Collection.Hyperf\Collection\Arr instead of Hyperf\Utils\Arr.hyperf/pipeline from hyperf/utils.Channel in Crontab.crontab:run cannot work.hyperf/collection from hyperf/utils.hyperf/conditionable and hyperf/tappable from hyperf/utils.consul from service-governance.hyperf/kafka.Query\Builder::upsert().running channel to make sure all crontab tasks handled successfully.grpc-server's dependency on hyperf/rpc.nullable for schemas which generated by cmd.kafka.default.enable to control the consumer start or not.client & socket config for kafka.hyperf/http2-client.AMQPConnection to support the latest php-amqplib.aspects.enum for hyperf/constants.Hyperf\Rpc\Protocol::getNormalizer.normalizer for json-rpc.rpc-multiplex and use protocol.normalizer for rpc-server.SwooleConnection::getSocket to get swoole response.Coroutine::stats() and Coroutine::exists().kafka.default.consume_timeout to control the consumer for consuming messages.Hyperf\Kafka\AbstractConsumer::isEnable() to control the kafka consumer start or not.producer->loop().normalizer of RPC Client themselves.ConfigChanged cannot dispatched when using apollo.charAt method to both Str and Stringable.Hyperf\Contract\JsonDeSerializable.Hyperf\Utils\Serializer\JsonDeNormalizer.1.x and 2.x.Handler when native-curl is supported.Hyperf\DbConnection\Listener\CreatingListener to Hyperf\DbConnection\Listener\InitUidOnCreatingListener.Google\Rpc\Status for GRPC.ulid and uuid for Model.GenSchemaCommand to generate schemas for swagger.appends($attributes) to model collections.put() and patch() to testing HTTP client.Hyperf\Grpc\Parser::statusFromResponse.uuid and ulid for Str and Stringable.swagger.scan.paths to rewrite scan paths for swagger.mixin method to Hyperf\Database\Model\Builder.Delete and Options for swagger.methods for Query\Builder and Paginator.clone method to Hyperf\Database\Model\Builder.ConfigChanged event to config-center.access_key and access_secret which used to connect aliyun nacos.PHP8.2.WebSocketHandeShakeException which should inheritance BadRequestHttpException.RPN.exec called by SwoolePostgresqlClient.hyperf/config-apollo cannot work.forceDeleting event to hyperf/database.SwowServer.hyperf/metric.addRestoreOrCreate extension to SoftDeletingScope.ResumeExitCoordinatorListener.System::getCpuCoresNum().$closure.tcp://host:port configuration redis sentry address.PgSQLSwooleConnection::unprepared cannot work.8.1.memberId and so on.Hyperf\Coordinator\Timer::stats().Hyperf\Nacos\Provider\ConfigProvider::listener().CoroutineServer Support for hyperf/metric.hyperf/metric.Server::stats() by loop.$timeout of Timer::tick() in hyperf/metric.signal cannot work when using swow.hyperf/metric.Hyperf\Rpc\PathGenerator\PathGenerator.@Annotation support, and uses PHP8 native annotation Attribute. Before updating, be sure to check whether the project has been replaced by Attribute.The following script can be executed to convert Doctrine Annotations to PHP8 Attributes.
Note: This script can only be executed under version 2.2
composer require hyperf/code-generator
php bin/hyperf.php code:generate -D app
Because the model base class has added type support for member variables, you need to use the following script to upgrade it to a new version.
composer require hyperf/code-generator
php vendor/bin/regenerate-models.php $PWD/app/Model
2.2 to 3.0, you need to run a static check to make sure it is works.composer analysis
Http status returned by gRPC Server according to the gRPC specification. It is fixed at 200, and gRPC Server returns the corresponding status code. Service upgrade to version 3.xphp-amqplib/php-amqplib to ^3.1;phpstan/phpstan to ^1.0;mix/redis-subscribe to mix/redis-subscriber:^3.0psr/simple-cache to ^1.0|^2.0|^3.0monolog/monolog to ^2.7|^3.1league/flysystem to ^1.0|^2.0|^3.0Hyperf\Amqp\IO\IOFactory which used to create amqp io by yourself.$suffix for trait Hyperf\Utils\Traits\StaticInstance.$description which used to set command description easily for Hyperf\Command\Command.Hyperf\Utils\IPReader to get local IP.Hyperf\Coordinator\Timer which can be stopped safely.Conditionable::when() and Conditionable::unless().Hyperf\Utils\Stringable implements Stringable.socketio-server.NullDisableEventDispatcher to disable event dispatcher by default.Scene which use scene in FormRequest easily.Db::beforeExecuting() to register a hook which to be run just before a database query is executed.ConsumerMessageInterface::getNums() to change the number of amqp consumer by dynamically.LoadBalancerInterface::afterRefreshed() to register a hook which to be run after refresh nodes.amqp.enable which used to control amqp consumer whether to start automatically and producer whether to declare automatically.hyperf/database-pgsql which you can be used to connect pgsql server.Hyperf\Database\Model\Concerns\HasAttributes::getRawOriginal().symfony.event.enable to control whether to use SymfonyEventDispatcher.Pipeline::thenReturn() method to run pipes and return the result$dictionary for Str::slug, your can rewrite some tags easily.config for command server:watch.CacheAhead which used to cache data ahead.Hyperf\WebSocketServer\Sender::getResponses().defer_release config in hyperf/dbext-posix for watcher.http://xxx.com/yyy/ instead of http://xxx.com:8848/ to connect nacos.DataFormatterInterface which uses object instead of array as inputs.Str::contains Str::startsWith and Str::endsWith based on PHP8.Hyperf\Context\Context which support coroutineId for set() override() and getOrSet().Hyperf\Utils\Str whose methods padBoth padLeft and padRight support multibyte.SafeCaller to avoid server shutdown which caused by exceptions.Redis::isConnected(), because it could be connected defer or reconnected after disconnected.wait instead of parallel for coroutine style tcp server.ignoreAnnotations for Annotation Reader.Hyperf\Di\ClassLoader::$proxies, because merge it into Composer\Autoload\ClassLoader::$classMap.Hyperf\Database\Model\Concerns\HasEvents::fireModelEvent().call() from Coroutine::create().Hyperf\Di\ClassLoader and Optimized Composer::getLoader().ConfirmableTrait, such as migrate command.socketio-server.call() from callable function.defer by default.public property $message to protected for Hyperf\AsyncQueue\Event\Event.$circularDependences to $checkCircularDependencies for Dag.hyperf/coordinator from hyperf/utils.0 from 1.Hyperf\Kafka\Exception\ConnectionCLosedException to Hyperf\Kafka\Exception\ConnectionClosedException.Hyperf\Database\Model\Builder::insertOrIgnore will be return affected count.null for Hyperf\DbConnection\Db::__connection().?? instead of ?: for $callback when using Stringable::when().Hyperf\Engine\Channel instead of Hyperf\Coroutine\Channel in hyperf/reactive-x.void for Hyperf\Event\Contract\ListenerInterface::process().PHP >= 8.0.ProcessManager when server shutdown.$value.timeout to $options.timeout for CircuitBreaker.AnnotationManager::getFormatedKey() to AnnotationManager::getFormattedKey().NoNodesAvailableException when cannot select any node from load balancer.settings.pid_file is null when using swow server.hyperf/devtool or set them in autoload/commands.Trace Annotation, because don't support array.Hyperf\Framework\SymfonyEventDispatcher by default, if you listen symfony events, you must open symfony.event.enable.(string) $throwable instead of sprintf for Hyperf\ExceptionHandler\Formatter\FormatterInterface::format().Jsonable and Xmlable to contract from utils.MessageBag and MessageProvider to contract from utils.$server in Hyperf\WebSocketServer\Server::deferOnOpen() to mixed.chunkById but the column is not existed.hyperf/amqp.Hyperf\Utils\Coroutine\Locker.Hyperf\Utils\WaitGroup.Swoole\Coroutine\Channel by Hyperf\Engine\Channel for all components.hyperf/websocket-server.hyperf/load-balancer.hyperf/server.hyperf/retry.hyperf/pool.hyperf/crontab.hyperf/nsq.hyperf/signal.Hyperf\AsyncQueue\Signal\DriverStopHandler.Hyperf\Utils\Resource.Hyperf\Utils\Context, please use Hyperf\Context\Context instead.hyperf/filesystem.doctrine/annotations, please use PHP8 Attributes.WARNING log message when amqp connection restart.Hyperf\Utils\Contracts\Arrayable will be deprecated, please use Hyperf\Contract\Arrayable instead.Hyperf\AsyncQueue\Message will be deprecated, please use Hyperf\AsyncQueue\JobMessage instead.Hyperf\Di\Container::getDefinitionSource() will be deprecated.PhpParser::getExprFromValue() does not support assoc array.$description and $signature for hyperf/command.socket-io client always reconnect when using coroutine style server.ProxyTrait::__getParamsMap can not work when using trait alias.RedisAdapter::mixSubscribe cannot work cased by redis prefix when using socketio-server.ComponentTagCompiler::escapeSingleQuotesOutsideOfPhpBlocks() cannot work.Swow.rpc-multiplex.//foo) when the routing prefix is end of '/'.Parallel.continue cannot work when using view-engine.pgsql.Request::parseHost does not work when host is invalid.RedisSentinel can't support empty password.PGSqlSwooleConnection::affectingStatement() can't work when the sql is wrong.KeepaliveConnection::isTimeout() can't work when using swow.di.