From 82dea98b8fdfa720e913426e36c8d3fa5798c4c8 Mon Sep 17 00:00:00 2001 From: Siam <59419979@qq.com> Date: Sun, 5 Nov 2023 02:58:24 +0000 Subject: [PATCH] Upgrade to 3.1 --- composer.json | 24 +++++------ installer/config.php | 40 +++++++++---------- installer/resources/amqp/amqp.php | 3 ++ .../resources/async_queue/async_queue.php | 2 +- installer/resources/bin/hyperf.stub | 2 +- .../resources/config_center/config_acm.php | 1 + .../resources/config_center/config_apollo.php | 1 + .../resources/config_center/config_etcd.php | 1 + .../resources/config_center/config_nacos.php | 1 + installer/resources/database/databases.php | 3 ++ installer/resources/database/redis.php | 3 ++ installer/resources/model_cache/databases.php | 3 ++ installer/resources/tracer/opentracing.php | 1 + 13 files changed, 51 insertions(+), 34 deletions(-) diff --git a/composer.json b/composer.json index e87a28e4..3c0a5791 100644 --- a/composer.json +++ b/composer.json @@ -13,22 +13,22 @@ "license": "Apache-2.0", "require": { "php": ">=8.0", - "hyperf/cache": "~3.0.0", - "hyperf/command": "~3.0.0", - "hyperf/config": "~3.0.0", - "hyperf/db-connection": "~3.0.0", + "hyperf/cache": "~3.1.0", + "hyperf/command": "~3.1.0", + "hyperf/config": "~3.1.0", + "hyperf/db-connection": "~3.1.0", "hyperf/engine": "^2.10", - "hyperf/framework": "~3.0.0", - "hyperf/guzzle": "~3.0.0", - "hyperf/http-server": "~3.0.0", - "hyperf/logger": "~3.0.0", - "hyperf/memory": "~3.0.0", - "hyperf/process": "~3.0.0" + "hyperf/framework": "~3.1.0", + "hyperf/guzzle": "~3.1.0", + "hyperf/http-server": "~3.1.0", + "hyperf/logger": "~3.1.0", + "hyperf/memory": "~3.1.0", + "hyperf/process": "~3.1.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", - "hyperf/devtool": "~3.0.0", - "hyperf/testing": "~3.0.0", + "hyperf/devtool": "~3.1.0", + "hyperf/testing": "~3.1.0", "mockery/mockery": "^1.0", "phpstan/phpstan": "^1.0", "swoole/ide-helper": "^5.0" diff --git a/installer/config.php b/installer/config.php index aecca426..a3a3b975 100644 --- a/installer/config.php +++ b/installer/config.php @@ -12,64 +12,64 @@ return [ 'packages' => [ 'hyperf/amqp' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/async-queue' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/database' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/db-connection' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/model-cache' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/constants' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/json-rpc' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/redis' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/rpc' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/rpc-client' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/rpc-server' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/grpc-client' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/grpc-server' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/elasticsearch' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/config-apollo' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/config-aliyun-acm' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/config-etcd' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/config-nacos' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/tracer' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], 'hyperf/service-governance' => [ - 'version' => '~3.0.0', + 'version' => '~3.1.0', ], ], 'require-dev' => [ diff --git a/installer/resources/amqp/amqp.php b/installer/resources/amqp/amqp.php index 934cf4b1..ba1bf577 100644 --- a/installer/resources/amqp/amqp.php +++ b/installer/resources/amqp/amqp.php @@ -9,6 +9,9 @@ * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + +use function Hyperf\Support\env; + return [ 'default' => [ 'host' => env('AMQP_HOST', 'localhost'), diff --git a/installer/resources/async_queue/async_queue.php b/installer/resources/async_queue/async_queue.php index b115ddf5..38ab8ecd 100644 --- a/installer/resources/async_queue/async_queue.php +++ b/installer/resources/async_queue/async_queue.php @@ -11,7 +11,7 @@ */ return [ 'default' => [ - 'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class, + 'driver' => \Hyperf\AsyncQueue\Driver\RedisDriver::class, 'redis' => [ 'pool' => 'default', ], diff --git a/installer/resources/bin/hyperf.stub b/installer/resources/bin/hyperf.stub index 710ad5ad..52e05b4b 100644 --- a/installer/resources/bin/hyperf.stub +++ b/installer/resources/bin/hyperf.stub @@ -9,7 +9,7 @@ error_reporting(E_ALL); date_default_timezone_set('%TIME_ZONE%'); ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1)); -! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL); +! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags()); require BASE_PATH . '/vendor/autoload.php'; diff --git a/installer/resources/config_center/config_acm.php b/installer/resources/config_center/config_acm.php index e08c65f6..147c76a1 100644 --- a/installer/resources/config_center/config_acm.php +++ b/installer/resources/config_center/config_acm.php @@ -10,6 +10,7 @@ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Hyperf\ConfigCenter\Mode; +use function Hyperf\Support\env; return [ 'enable' => (bool) env('CONFIG_CENTER_ENABLE', true), diff --git a/installer/resources/config_center/config_apollo.php b/installer/resources/config_center/config_apollo.php index 289f1762..3dee984f 100644 --- a/installer/resources/config_center/config_apollo.php +++ b/installer/resources/config_center/config_apollo.php @@ -11,6 +11,7 @@ */ use Hyperf\ConfigApollo\PullMode; use Hyperf\ConfigCenter\Mode; +use function Hyperf\Support\env; return [ 'enable' => (bool) env('CONFIG_CENTER_ENABLE', true), diff --git a/installer/resources/config_center/config_etcd.php b/installer/resources/config_center/config_etcd.php index 426ce672..74ec6826 100644 --- a/installer/resources/config_center/config_etcd.php +++ b/installer/resources/config_center/config_etcd.php @@ -10,6 +10,7 @@ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Hyperf\ConfigCenter\Mode; +use function Hyperf\Support\env; return [ 'enable' => (bool) env('CONFIG_CENTER_ENABLE', true), diff --git a/installer/resources/config_center/config_nacos.php b/installer/resources/config_center/config_nacos.php index ed4a1055..5c7baeb9 100644 --- a/installer/resources/config_center/config_nacos.php +++ b/installer/resources/config_center/config_nacos.php @@ -10,6 +10,7 @@ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Hyperf\ConfigCenter\Mode; +use function Hyperf\Support\env; return [ 'enable' => (bool) env('CONFIG_CENTER_ENABLE', true), diff --git a/installer/resources/database/databases.php b/installer/resources/database/databases.php index ddba15da..bf29bfef 100644 --- a/installer/resources/database/databases.php +++ b/installer/resources/database/databases.php @@ -9,6 +9,9 @@ * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + +use function Hyperf\Support\env; + return [ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), diff --git a/installer/resources/database/redis.php b/installer/resources/database/redis.php index 3180b62c..46dd3579 100644 --- a/installer/resources/database/redis.php +++ b/installer/resources/database/redis.php @@ -9,6 +9,9 @@ * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + +use function Hyperf\Support\env; + return [ 'default' => [ 'host' => env('REDIS_HOST', 'localhost'), diff --git a/installer/resources/model_cache/databases.php b/installer/resources/model_cache/databases.php index b164103d..ae6f9e7e 100644 --- a/installer/resources/model_cache/databases.php +++ b/installer/resources/model_cache/databases.php @@ -9,6 +9,9 @@ * @contact group@hyperf.io * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ + +use function Hyperf\Support\env; + return [ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), diff --git a/installer/resources/tracer/opentracing.php b/installer/resources/tracer/opentracing.php index 8b4dbd15..2eacdde5 100644 --- a/installer/resources/tracer/opentracing.php +++ b/installer/resources/tracer/opentracing.php @@ -10,6 +10,7 @@ * @license https://github.com/hyperf/hyperf/blob/master/LICENSE */ use Zipkin\Samplers\BinarySampler; +use function Hyperf\Support\env; return [ 'default' => env('TRACER_DRIVER', 'zipkin'),