{{ message }}
Releases: hyperf/hyperf
Releases · hyperf/hyperf
Release v3.2.1
Fixed
- #7760 Fixed bug that
ModelRewriteInheritanceVisitorcannot work for commandgen:model.
Added
- #7759 Added
Hyperf\Logger\Handler\StreamHandlerwhich don't containset_error_handler.
Optimized
- #7761 Optimized
Hyperf\Coordinator\Timer::tick()to run the callback insideHyperf\Coroutine\wait()so it executes in a properly managed coroutine context. - #7761 Optimize the
wait()method to check whetherHyperf\Coroutine\Waiterexists in theContainer.
Full Changelog: v3.2.0...v3.2.1
Release v3.1.70
What's Changed
- docs: add indonesian translation for hyperf by @aldok10 in #7752
- Optimized
Hyperf\Coordinator\Timer::tick()to run the callback insideHyperf\Coroutine\wait()so it executes in a properly managed coroutine context. by @huangdijia in #7761 - Release v3.1.70 by @limingxinleo in #7762
Full Changelog: v3.1.69...v3.1.70
Release v3.2.0
Break Changes
-
The BC of Carbon component
Carbon::createFromTimestamp()don't read the default timezone bydate_default_timezone_get()forv3.0.Carbon::diffInDays()no longer returns an absolute value by default. Use the$absoluteparameter to control whether the result is absolute.
-
#7625 Renamed
JobInterface::getQueueName()togetPoolName()in async-queue component for terminology consistency.
<?php
// Before
class CustomJob extends \Hyperf\AsyncQueue\Job
{
public function getQueueName(): string
{
return 'custom';
}
}
// After
class CustomJob extends \Hyperf\AsyncQueue\Job
{
public function getPoolName(): string
{
return 'custom';
}
}<?php
use Carbon\Carbon;
$t = time();
# The break usage
Carbon::createFromTimestamp($t, date_default_timezone_get());
# The correct usage
Carbon::createFromTimestamp($t, date_default_timezone_get());- The
loggerconfiguration structure has been changed. Please refer to #7563.
<?php
// Before
return [
'default' => [
'driver' => 'daily',
'path' => BASE_PATH . '/runtime/logs/hyperf.log',
'level' => env('LOG_LEVEL', 'debug'),
'days' => 7,
],
];
// After
return [
'default' => 'default',
'channels' => [
'default' => [
'driver' => 'daily',
'path' => BASE_PATH . '/runtime/logs/hyperf.log',
'level' => env('LOG_LEVEL', 'debug'),
'days' => 7,
],
// Add your custom channels here
],
];- The
cacheconfiguration structure has been changed. Please refer to #7594.
<?php
// Before
return [
'default' => [
'driver' => RedisDriver::class,
'packer' => PhpSerializerPacker::class,
'prefix' => 'c:',
],
];
// After
return [
'default' => env('CACHE_DRIVER', 'default'),
'stores' => [
'default' => [
'driver' => RedisDriver::class,
'packer' => PhpSerializerPacker::class,
'prefix' => 'c:',
],
],
];- Added dependencies when using
swow.
config/autoload/dependencies.php
<?php
use Hyperf\Contract\ResponseEmitterInterface;
use Hyperf\Engine\ResponseEmitter;
return [
ResponseEmitterInterface::class => ResponseEmitter::class,
];Warn
- If you have upgraded to PHP 8.4, please note that both the
fgetcsvandfputcsvmethods now require providing a default value for theescapeparameter.
fputcsv($fp, $fields) must be changed to fputcsv($fp, $fields, escape: '')
fgetcsv($fp) must be changed to fgetcsv($fp, escape: '')
Dependencies Upgrade
- Upgrade the php version to
>=8.2 - Upgrade the
elasticsearch/elasticsearchversion to^8.0 || ^9.0 - Upgrade the
nikic/php-parserversion to5.6 - Upgrade the
symfony/*components to^6.0 || ^7.0 - Upgrade the
phpunit/phpunitversion to^11.0 - Upgrade the version of
google/protobufto^3.6.1 || ^4.2. - Upgrade the version of
guzzlehttp/guzzleto^7.0.
Removed
- #7278 Removed abandoned
laminas/laminas-mimepackage. - #7573 Removed deprecated
Hyperf\Serializer\Contract\CacheableSupportsMethodInterfaceinterface. - #7609 Removed backward compatibility code from
Hyperf\AsyncQueue\JobMessageserialization. - #7610 Removed deprecated code scheduled for v3.2 removal, including Collection backward compatibility, ProxyTrait parameter mapping,
ResumeExitCoordinatorListener, SocketIO Futureflagparameter, and WebSocketHandeShakeExceptiontypo alias.
Optimized
- #6804 Optimized the code for reading contents from file when using
Hyperf\Di\ReflectionManager::getAllClassesByFinder(). - #7142 Enhance array shuffle method to support custom random engines.
- #7431 Optimized the
toCssClassesandtoCssStylesmethods by directly using the input array to simplify the code logic. - #7523 Modernize array utilities and JSON validation using PHP 8.4+ functions with polyfills.
- #7620 Added Symfony 7.4 compatibility with batch command registration.
- #7653 Improved
Parser::parseResponsereturn value format by replacingGrpc\StringifyAblewithGoogle\Rpc\Statusobjects for better standardization and code readability. - #7658 Optimized event listener provider by adding cache for non-anonymous event classes to avoid repeated listener resolution.
Added
- #6538 Support to specify the queue name based on the
job. - #6591 Support
v3.0fornesbot/carbon. - #6761 Added
toJsonmethod toHyperf\Contract\Jsonable. - #6794 feat: Add Htmlable contract interface for HTTP responses.
- #7019 Added PDO subclass support for PHP 8.4.
- #7198 Added connection name to
QueryException. - #7202 Added support for elasticsearch
8.x. - #7629 Added support for elasticsearch
9.x. - #7214 Improve
Hyperf\Support\Fluent. - #7247 Added
Hyperf\Pipeline\Pipeline::finally(). - #7274 Support to take multiple items for
shift()andpop()inHyperf\Collection\Collection. - #7302 Added
partition()andreject()toHyperf\Collection\Arr. - #7312 Added
Macroablesupport toHyperf\Context\Context. - #7605 Added
NonCoroutineattribute for flexible test execution control. - #7618 Added a new registration mode for async queue consumer processes that supports automatic registration based on configuration, eliminating the need for manual process registration in
config/autoload/processes.php. - #7621 Added timestamp prefix to
StdoutLoggeroutput format. - #7717 Added package
database-sqlserver.
Changed
- #6760 Changed the default type of
deleted_attodatetimeforhyperf/database. - #7208 Throw exceptions when the value is smaller than zero for
Hyperf\Database\Query\Builder::limit(). - #7372 Use empty string as
escapefor functionstr_getcsv. - #7462 Replaced
influxdb/influxdb-phpintoinfluxdata/influxdb-client-php. - #7563 Changed the
loggerconfiguration structure. - #7594 Changed the
cacheconfiguration structure. - #7615 Renamed
$queueproperty to$poolinConsumerProcessfor async-queue component. - #7625 Renamed
getQueueName()togetPoolName()in async-queue component for terminology consistency. - #7714 Don't support Monolog 2.x, only 3.x is supported.
Fixed
- #6934 Fixed bug that
sortByMany()don't return the same result likesortBy().
New Contributors
- @SkibidiProduction made their first contribution in #7585
- @L4ZARIN3 made their first contribution in #7674
- @NoraClapham made their first contribution in #7703
- @wregis made their first contribution in #7676
- @adhikjoshi made their first contribution in #7607
- @Dmcz made their first contribution in #7695
- @rpmoura made their first contribution in #7372
- @sabinm677 made their first contribution in #7723
- @suyar made their first contribution in #7734
- @ikolossov made their first contribution in #7736
Full Changelog: v3.1.63...v3.2.0
Release v3.1.69
Fixed
- #7731 Fixed bug that the
MacroableofHyperf\HttpServer\Responsecannot work. - #7734 Fixed bug that memory leak when using
Redis::pipeline()for long-lived environment. - #7736 Fixed bug that
keysmethod inRedisDriverdoes not return array whensMembersreturns a non-array value. - #7737 Fixed bug that PostgresProcessor cannot process indexes and foreign keys when columns is null.
- #7745 Fixed bug that
getUri()->getHost()returns server IP instead of domain when using Swoole 6.2.0, due toserver_addrhaving higher priority thanheader['host']ingetUriFromGlobals().
New Contributors
- @suyar made their first contribution in #7734
- @ikolossov made their first contribution in #7736
Full Changelog: v3.1.68...v3.1.69
Release v3.1.68
Fixed
- #7738 Fixed bug that
Hyperf\Database\Concerns\BuildsQueries::getOriginalColumnNameForCursorPaginationcannot work. - #7739 Fixed bug that http server broken by
nacosservice not found. - #7740 Fixed bug that
Aws\Handler\GuzzleV6\GuzzleHandlernot found.
Optimized
- #7741 Optimized the
Hyperf\Amqp\Message\Message::getTypeString()method to prevent conflicts between property and getter methods.
Full Changelog: v3.1.67...v3.1.68
Release v3.1.67
Added
- #7459 Support using model name like
App\\Model\\Userfor validation ruleexistsandunique. - #7555 Added
Hyperf\Crontab\Mutex\RedisServerMutexByNodeName. - #7607 Added casts
AsCollectionforhyperf/database. - #7648 Support aliyun mse signature for nacos.
Optimized
- #7676 Optimized the client tagging for
hyperf/tracer.
Fixed
- #7703 Fixed bug that the default ttl cannot work for memory driver of
hyperf/cache. - #7705 Fixed bug that
eachByIdcannot work forHyperf\Database\Query\Builder. - #7712 Fixed bug that the classes cache cannot decode.
New Contributors
- @NoraClapham made their first contribution in #7703
- @wregis made their first contribution in #7676
- @adhikjoshi made their first contribution in #7607
Full Changelog: v3.1.66...v3.1.67
Release v3.1.66
Added
- #7667 #7672 Added support for
client_countoption to create multiple gRPC clients with load balancing inhyperf/grpc-client. - #7668 Added the
$isCookiePersistentparameter toHyperf\Guzzle\PoolHandlerto enable persistent cookies. - #7670 Added
--pathoption to generator commands for specifying custom output locations. - #7684 Added method
Hyperf\Database\Schema\Builder::withoutForeignKeyConstraints(). - #7693 Added methods
cascadeOnDelete(),restrictOnDelete(),noActionOnDelete(),restrictOnUpdate(),nullOnUpdate(),noActionOnUpdate()forForeignKeyDefinition. - #7698 Added
Pool::flushAll()andPoolFactory::flushAll()methods to close all pool connections. - #7699 Added methods
whereJsonContainsKey(),orWhereJsonContainsKey(),whereJsonDoesntContainKey(),orWhereJsonDoesntContainKey()for Query Builder.
Optimized
- #7675 Removed redundant timer cleanup code from metric listeners since the Timer component now handles cleanup automatically.
- #7687 Optimized handling of
ValidationExceptionin JSON-RPC core middleware to properly returnINVALID_PARAMSerror responses.
Fixed
- #7669 Fix PostgreSQL boolean handling for emulated prepares and raw SQL.
- #7682 Fixed incorrect return type for
Blueprint::foreign()which caused static analysis errors when chainingreferences(),on(), etc.
New Contributors
Full Changelog: v3.1.65...v3.1.66
v3.2.0-alpha.4
What's Changed
- refactor(database): extract HasUniqueStringIds trait to reduce code duplication by @huangdijia in #7590
- refactor(logger): optimize logger configuration structure by @huangdijia in #7563
- Fixed BC when validation rule not define. by @xuanyanwow in #7596
- chore(ci): remove symfony/console version constraint in test workflow by @huangdijia in #7595
- refactor(cache): refactor cache configuration pattern by @huangdijia in #7594
- feat: Add Htmlable contract interface for HTTP responses by @huangdijia in #6794
- Added PDO subclass support for PHP 8.4 by @huangdijia in #7019
- [3.2]Enhance array shuffle method to support custom random engines by @huangdijia in #7142
- refactor(testing): optimize ClassLoader detection in phpunit-patch by @huangdijia in #7592
- chore(ci): upgrade Swoole version from v6.1.0 to v6.1.1 by @huangdijia in #7588
- Added
Hyperf\Collection\Arr::sole()method by @huangdijia in #7600 - feat(async-queue): add result handling for job processing by @huangdijia in #7601
- fix(async-queue): relax type hint for callback message parameter by @huangdijia in #7602
- refactor(async-queue): strengthen Result type handling in Driver and AfterHandle event by @huangdijia in #7603
- Optimized AnnotationJob to support call protected / private methods. by @huangdijia in #7604
- refactor(testing): add NonCoroutine attribute for flexible test execution control by @huangdijia in #7605
- refactor(async-queue): remove JobMessage backward compatibility code by @huangdijia in #7609
- docs(command): add @param-closure-this annotation for better IDE support by @huangdijia in #7611
- refactor: remove deprecated code scheduled for v3.2 removal by @huangdijia in #7610
- Fixed setlocale set failed by @xuanyanwow in #7612
- refactor(async-queue): rename $queue property to $pool in ConsumerProcess by @huangdijia in #7615
- feat(async-queue): add automatic consumer process registration based on configuration by @huangdijia in #7618
- feat(framework): Add Symfony 7.4 compatibility with batch command registration by @Copilot in #7620
- refactor(async-queue): rename getQueueName to getPoolName for consistency by @huangdijia in #7625
Full Changelog: v3.2.0-alpha.3...v3.2.0-alpha.4
v3.1.64
Added
- #7600 Added method
Hyperf\Collection\Arr::sole(). - #7601 Added result handling for async queue jobs with
Hyperf\AsyncQueue\Resultenum.
Optimized
- #7604 Optimized
AnnotationJobto support call protected / private methods. - #7611 Added
@param-closure-thisannotation toConsole::command()for better IDE support. - #7615 Renamed
$queueproperty to$poolinConsumerProcessfor better code clarity inhyperf/async-queue.
Fixed
- #7596 Fixed BC when
validationrule not define.
Full Changelog: v3.1.63...v3.1.64
Pre-Release v3.2.0-alpha.3
What's Changed
- fix(command): add coordinator cleanup in command execution finally block by @huangdijia in #7545
- Support to rewrite the rules for scene when using validation. by @limit81995 in #7469
- Made
Hyperf\Kafka\Annotation\Consumer::$poolempty by default by @aneterial in #7547 - Support options
batchformigrate:rollback. by @albertcht in #7531 - Release v3.1.62 by @limingxinleo in #7560
- Revert constructor parameter name change for
Nacos\Applicationby @huangdijia in #7561 - Support method
PATCHforhyperf/testing. by @aneterial in #7553 - Fixed bug that the providers of nacos not support psr4. by @Ulyssesyi in #7543
- Upgrade to nikic/php-parser v5 and update parser usage by @huangdijia in #7566
- Update Symfony dependencies to ^6.0 || ^7.0 by @huangdijia in #7573
- Update PHPUnit to version 11 by @huangdijia in #7577
- Support Swoole v6.1.0 by @huangdijia in #7575
- Optimized the PHPDoc for
hyperf/database. by @storyn26383 in #7511 - Fixed bug that the parameter context on redis cluster cannot work when auth config isn't set or set with null value. by @luizmanhani in #7554
- Fixed bug that
Hyperf\Validation\ValidationRuleParser::parseParameters()cannot supportPHP 8.4. by @sy-records in #7536 - fix: 添加对CacheableSupportsMethodInterface的弃用说明 by @huangdijia in #7574
- Changed the default type of
deleted_attodatetimeforhyperf/database. by @MorriosL in #6760 - feature: Added PHPStan type analysis for
hyperf/collectionby @huangdijia in #7578 - Use
priorityMiddlewareinstead ofmiddlewarefor swagger. by @zds-s in #7537 - Add
/types export-ignoreto all.gitattributesinsrc/*by @Copilot in #7581 - Release v3.1.63 by @limingxinleo in #7582
- Fixed PHPStan type assertions in database model types by @huangdijia in #7583
New Contributors
- @aneterial made their first contribution in #7547
- @storyn26383 made their first contribution in #7511
Full Changelog: v3.2.0-alpha.2...v3.2.0-alpha.3
