mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
Added config etcd component.
This commit is contained in:
parent
3dce42e846
commit
b386fc8de3
@ -20,6 +20,7 @@
|
||||
"google/protobuf": "^3.6.1",
|
||||
"grpc/grpc": "^1.15",
|
||||
"guzzlehttp/guzzle": "^6.3",
|
||||
"linkorb/etcd-php": "^1.6",
|
||||
"monolog/monolog": "^1.24",
|
||||
"nesbot/carbon": "^2.0",
|
||||
"nikic/fast-route": "^1.3",
|
||||
@ -55,6 +56,7 @@
|
||||
"hyperf/command": "self.version",
|
||||
"hyperf/config": "self.version",
|
||||
"hyperf/config-apollo": "self.version",
|
||||
"hyperf/config-etcd": "self.version",
|
||||
"hyperf/constants": "self.version",
|
||||
"hyperf/consul": "self.version",
|
||||
"hyperf/contract": "self.version",
|
||||
@ -109,6 +111,7 @@
|
||||
"Hyperf\\Config\\": "src/config/src/",
|
||||
"Hyperf\\Command\\": "src/command/src/",
|
||||
"Hyperf\\ConfigApollo\\": "src/config-apollo/src/",
|
||||
"Hyperf\\ConfigEtcd\\": "src/config-etcd/src/",
|
||||
"Hyperf\\Constants\\": "src/constants/src/",
|
||||
"Hyperf\\Consul\\": "src/consul/src/",
|
||||
"Hyperf\\Contract\\": "src/contract/src/",
|
||||
@ -154,6 +157,7 @@
|
||||
"HyperfTest\\AsyncQueue\\": "./src/async-queue/tests/",
|
||||
"HyperfTest\\Cache\\": "./src/cache/tests/",
|
||||
"HyperfTest\\ConfigApollo\\": "./src/config-apollo/tests/",
|
||||
"HyperfTest\\ConfigEtcd\\": "./src/config-etcd/tests/",
|
||||
"HyperfTest\\Constants\\": "./src/constants/tests/",
|
||||
"HyperfTest\\Consul\\": "./src/consul/tests/",
|
||||
"HyperfTest\\Di\\": "./src/di/tests/",
|
||||
@ -190,6 +194,7 @@
|
||||
"Hyperf\\CircuitBreaker\\ConfigProvider",
|
||||
"Hyperf\\Config\\ConfigProvider",
|
||||
"Hyperf\\ConfigApollo\\ConfigProvider",
|
||||
"Hyperf\\ConfigEtcd\\ConfigProvider",
|
||||
"Hyperf\\Devtool\\ConfigProvider",
|
||||
"Hyperf\\DbConnection\\ConfigProvider",
|
||||
"Hyperf\\Di\\ConfigProvider",
|
||||
|
1
src/config-etcd/.gitattributes
vendored
Normal file
1
src/config-etcd/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
||||
/tests export-ignore
|
1
src/config-etcd/README.md
Normal file
1
src/config-etcd/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Etcd
|
50
src/config-etcd/composer.json
Normal file
50
src/config-etcd/composer.json
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "hyperf/config-etcd",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"php",
|
||||
"hyperf",
|
||||
"etcd",
|
||||
"config"
|
||||
],
|
||||
"description": "Etcd Config Center for Hyperf.",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hyperf\\ConfigEtcd\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"HyperfTest\\ConfigEtcd\\": "tests/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"ext-swoole": ">=4.3",
|
||||
"hyperf/utils": "~1.0.0",
|
||||
"hyperf/etcd": "~1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^2.14",
|
||||
"hyperf/testing": "1.0.*",
|
||||
"phpstan/phpstan": "^0.10.5",
|
||||
"swoft/swoole-ide-helper": "dev-master"
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"scripts": {
|
||||
"test": "co-phpunit -c phpunit.xml --colors=always",
|
||||
"analyze": "phpstan analyse --memory-limit 300M -l 0 ./src",
|
||||
"cs-fix": "php-cs-fixer fix $1"
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
},
|
||||
"hyperf": {
|
||||
"config": "Hyperf\\ConfigEtcd\\ConfigProvider"
|
||||
}
|
||||
}
|
||||
}
|
31
src/config-etcd/src/ConfigProvider.php
Normal file
31
src/config-etcd/src/ConfigProvider.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://doc.hyperf.io
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace Hyperf\Etcd;
|
||||
|
||||
class ConfigProvider
|
||||
{
|
||||
public function __invoke(): array
|
||||
{
|
||||
return [
|
||||
'dependencies' => [
|
||||
],
|
||||
'commands' => [
|
||||
],
|
||||
'scan' => [
|
||||
'paths' => [
|
||||
__DIR__,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@
|
||||
"require": {
|
||||
"php": ">=7.2",
|
||||
"ext-swoole": ">=4.3",
|
||||
"hyperf/utils": "1.0.*",
|
||||
"hyperf/utils": "~1.0.0",
|
||||
"linkorb/etcd-php": "^1.6"
|
||||
},
|
||||
"require-dev": {
|
||||
|
@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace Hyperf\Etcd;
|
||||
namespace Hyperf\ConfigEtcd;
|
||||
|
||||
class ConfigProvider
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user