3.2 升级指南
3.2 升级指南
- 3.2 版本主要修改了
PHP最低版本为8.2。 - 升级
symfony/*组件至支持^6.0 || ^7.0。 - 升级
phpunit/phpunit至^11.0。
不兼容变更
async-queue组件将JobInterface::getQueueName()重命名为getPoolName()。
<?php
// 变更前
class CustomJob extends \Hyperf\AsyncQueue\Job
{
public function getQueueName(): string
{
return 'custom';
}
}
// 变更后
class CustomJob extends \Hyperf\AsyncQueue\Job
{
public function getPoolName(): string
{
return 'custom';
}
}<?php
// config/autoload/dependencies.php
use Hyperf\Contract\ResponseEmitterInterface;
use Hyperf\Engine\ResponseEmitter;
return [
ResponseEmitterInterface::class => ResponseEmitter::class,
];依赖升级
- 升级 php 版本至
>=8.2。 - 升级
elasticsearch/elasticsearch至^8.0 || ^9.0。 - 升级
nikic/php-parser至5.6。 - 升级
symfony/*组件至^6.0 || ^7.0。 - 升级
phpunit/phpunit至^11.0。 - 升级
google/protobuf至^3.6.1 || ^4.2。 - 升级
guzzlehttp/guzzle至^7.0。
注意
如果你已经升级到 PHP 8.4,fgetcsv 和 fputcsv 方法现在都需要为 escape 参数提供默认值。
fputcsv($fp, $fields, escape: '');
fgetcsv($fp, escape: '');