Skip to content

Commit

Permalink
Removed useless code from config-center.
Browse files Browse the repository at this point in the history
  • Loading branch information
limingxinleo committed Sep 7, 2021
1 parent a52c6a7 commit 1fa12a2
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 199 deletions.
2 changes: 1 addition & 1 deletion installer/OptionalPackages.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function installHyperfScript()
implode('', $ask),
function ($value) {
if ($value === 'y' || $value === 'yes') {
throw new \InvalidArgumentException("You should type a time zone name, like Asia/Shanghai. Or type n to skip.");
throw new \InvalidArgumentException('You should type a time zone name, like Asia/Shanghai. Or type n to skip.');
}

return $value;
Expand Down
53 changes: 0 additions & 53 deletions installer/resources/config_center/config_acm.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,13 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\ConfigApollo\PullMode;
use Hyperf\ConfigCenter\Mode;

return [
'enable' => (bool) env('CONFIG_CENTER_ENABLE', true),
'driver' => env('CONFIG_CENTER_DRIVER', 'aliyun_acm'),
'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS),
'drivers' => [
'apollo' => [
'driver' => Hyperf\ConfigApollo\ApolloDriver::class,
'pull_mode' => PullMode::INTERVAL,
'server' => 'http://127.0.0.1:9080',
'appid' => 'test',
'cluster' => 'default',
'namespaces' => [
'application',
],
'interval' => 5,
'strict_mode' => false,
'client_ip' => current(swoole_get_local_ip()),
'pullTimeout' => 10,
'interval_timeout' => 1,
],
'nacos' => [
'driver' => Hyperf\ConfigNacos\NacosDriver::class,
'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE,
'interval' => 3,
'default_key' => 'nacos_config',
'listener_config' => [
// dataId, group, tenant, type, content
'nacos_config' => [
'tenant' => 'tenant', // corresponding with service.namespaceId
'data_id' => 'hyperf-service-config',
'group' => 'DEFAULT_GROUP',
],
'nacos_config.data' => [
'data_id' => 'hyperf-service-config-yml',
'group' => 'DEFAULT_GROUP',
'type' => 'yml',
],
],
],
'aliyun_acm' => [
'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class,
'interval' => 5,
Expand All @@ -62,23 +27,5 @@
'secret_key' => env('ALIYUN_ACM_SK', ''),
'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''),
],
'etcd' => [
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
'namespaces' => [
'/application',
],
'mapping' => [
// etcd key => config key
'/application/test' => 'test',
],
'interval' => 5,
],
'zookeeper' => [
'driver' => Hyperf\ConfigZookeeper\ZookeeperDriver::class,
'server' => env('ZOOKEEPER_SERVER', '127.0.0.1:2181'),
'path' => env('ZOOKEEPER_CONFIG_PATH', '/conf'),
'interval' => 5,
],
],
];
48 changes: 0 additions & 48 deletions installer/resources/config_center/config_apollo.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,53 +32,5 @@
'pullTimeout' => 10,
'interval_timeout' => 1,
],
'nacos' => [
'driver' => Hyperf\ConfigNacos\NacosDriver::class,
'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE,
'interval' => 3,
'default_key' => 'nacos_config',
'listener_config' => [
// dataId, group, tenant, type, content
'nacos_config' => [
'tenant' => 'tenant', // corresponding with service.namespaceId
'data_id' => 'hyperf-service-config',
'group' => 'DEFAULT_GROUP',
],
'nacos_config.data' => [
'data_id' => 'hyperf-service-config-yml',
'group' => 'DEFAULT_GROUP',
'type' => 'yml',
],
],
],
'aliyun_acm' => [
'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class,
'interval' => 5,
'endpoint' => env('ALIYUN_ACM_ENDPOINT', 'acm.aliyun.com'),
'namespace' => env('ALIYUN_ACM_NAMESPACE', ''),
'data_id' => env('ALIYUN_ACM_DATA_ID', ''),
'group' => env('ALIYUN_ACM_GROUP', 'DEFAULT_GROUP'),
'access_key' => env('ALIYUN_ACM_AK', ''),
'secret_key' => env('ALIYUN_ACM_SK', ''),
'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''),
],
'etcd' => [
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
'namespaces' => [
'/application',
],
'mapping' => [
// etcd key => config key
'/application/test' => 'test',
],
'interval' => 5,
],
'zookeeper' => [
'driver' => Hyperf\ConfigZookeeper\ZookeeperDriver::class,
'server' => env('ZOOKEEPER_SERVER', '127.0.0.1:2181'),
'path' => env('ZOOKEEPER_CONFIG_PATH', '/conf'),
'interval' => 5,
],
],
];
52 changes: 0 additions & 52 deletions installer/resources/config_center/config_etcd.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,59 +9,13 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\ConfigApollo\PullMode;
use Hyperf\ConfigCenter\Mode;

return [
'enable' => (bool) env('CONFIG_CENTER_ENABLE', true),
'driver' => env('CONFIG_CENTER_DRIVER', 'etcd'),
'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS),
'drivers' => [
'apollo' => [
'driver' => Hyperf\ConfigApollo\ApolloDriver::class,
'pull_mode' => PullMode::INTERVAL,
'server' => 'http://127.0.0.1:9080',
'appid' => 'test',
'cluster' => 'default',
'namespaces' => [
'application',
],
'interval' => 5,
'strict_mode' => false,
'client_ip' => current(swoole_get_local_ip()),
'pullTimeout' => 10,
'interval_timeout' => 1,
],
'nacos' => [
'driver' => Hyperf\ConfigNacos\NacosDriver::class,
'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE,
'interval' => 3,
'default_key' => 'nacos_config',
'listener_config' => [
// dataId, group, tenant, type, content
'nacos_config' => [
'tenant' => 'tenant', // corresponding with service.namespaceId
'data_id' => 'hyperf-service-config',
'group' => 'DEFAULT_GROUP',
],
'nacos_config.data' => [
'data_id' => 'hyperf-service-config-yml',
'group' => 'DEFAULT_GROUP',
'type' => 'yml',
],
],
],
'aliyun_acm' => [
'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class,
'interval' => 5,
'endpoint' => env('ALIYUN_ACM_ENDPOINT', 'acm.aliyun.com'),
'namespace' => env('ALIYUN_ACM_NAMESPACE', ''),
'data_id' => env('ALIYUN_ACM_DATA_ID', ''),
'group' => env('ALIYUN_ACM_GROUP', 'DEFAULT_GROUP'),
'access_key' => env('ALIYUN_ACM_AK', ''),
'secret_key' => env('ALIYUN_ACM_SK', ''),
'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''),
],
'etcd' => [
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
Expand All @@ -74,11 +28,5 @@
],
'interval' => 5,
],
'zookeeper' => [
'driver' => Hyperf\ConfigZookeeper\ZookeeperDriver::class,
'server' => env('ZOOKEEPER_SERVER', '127.0.0.1:2181'),
'path' => env('ZOOKEEPER_CONFIG_PATH', '/conf'),
'interval' => 5,
],
],
];
45 changes: 0 additions & 45 deletions installer/resources/config_center/config_nacos.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,13 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use Hyperf\ConfigApollo\PullMode;
use Hyperf\ConfigCenter\Mode;

return [
'enable' => (bool) env('CONFIG_CENTER_ENABLE', true),
'driver' => env('CONFIG_CENTER_DRIVER', 'nacos'),
'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS),
'drivers' => [
'apollo' => [
'driver' => Hyperf\ConfigApollo\ApolloDriver::class,
'pull_mode' => PullMode::INTERVAL,
'server' => 'http://127.0.0.1:9080',
'appid' => 'test',
'cluster' => 'default',
'namespaces' => [
'application',
],
'interval' => 5,
'strict_mode' => false,
'client_ip' => current(swoole_get_local_ip()),
'pullTimeout' => 10,
'interval_timeout' => 1,
],
'nacos' => [
'driver' => Hyperf\ConfigNacos\NacosDriver::class,
'merge_mode' => Hyperf\ConfigNacos\Constants::CONFIG_MERGE_OVERWRITE,
Expand All @@ -51,34 +35,5 @@
],
],
],
'aliyun_acm' => [
'driver' => Hyperf\ConfigAliyunAcm\AliyunAcmDriver::class,
'interval' => 5,
'endpoint' => env('ALIYUN_ACM_ENDPOINT', 'acm.aliyun.com'),
'namespace' => env('ALIYUN_ACM_NAMESPACE', ''),
'data_id' => env('ALIYUN_ACM_DATA_ID', ''),
'group' => env('ALIYUN_ACM_GROUP', 'DEFAULT_GROUP'),
'access_key' => env('ALIYUN_ACM_AK', ''),
'secret_key' => env('ALIYUN_ACM_SK', ''),
'ecs_ram_role' => env('ALIYUN_ACM_RAM_ROLE', ''),
],
'etcd' => [
'driver' => Hyperf\ConfigEtcd\EtcdDriver::class,
'packer' => Hyperf\Utils\Packer\JsonPacker::class,
'namespaces' => [
'/application',
],
'mapping' => [
// etcd key => config key
'/application/test' => 'test',
],
'interval' => 5,
],
'zookeeper' => [
'driver' => Hyperf\ConfigZookeeper\ZookeeperDriver::class,
'server' => env('ZOOKEEPER_SERVER', '127.0.0.1:2181'),
'path' => env('ZOOKEEPER_CONFIG_PATH', '/conf'),
'interval' => 5,
],
],
];

0 comments on commit 1fa12a2

Please sign in to comment.