phpone/yii2-apollo
Composer 安装命令:
composer require phpone/yii2-apollo
包简介
yii2-apollo client
README 文档
README
Instruction
- install
composer require phpone/yii2-apollo
- change .env file
APP_ID=1 CLUSTER=default APOLLO_NAMESPACES="application,hogwarts.common_snape_config" APOLLO_COMMON_NAMESPACE="hogwarts.common_snape_config" APOLLO_CONFIG_SERVER=127.0.0.1
- add configuration in console.php & web.php
[
'aliases' => [
'@storagePath' => '@app/storage',
'@apolloPath' => '@storagePath/apollo'
]
];
- add configuration in console.php
[
'controllerMap' => [
'apollo.start-agent' => [
'class' => 'Wby\ApolloYii\commands\ApolloClientController',
'namespaces' => explode(',', getenv('APOLLO_NAMESPACES', 'application')),
'cluster' => getenv('APOLLO_CLUSTER', 'default'),
'save_dir' => '@apolloPath',
'config_server' => getenv('APOLLO_CONFIG_SERVER', 'http://192.168.100.184:8090'),
'app_id' => getenv('APP_ID'),
'timeout_interval' => 70
]
]
];
use
- exec ./yii apollo.start-agent , if you want to keep the script run in daemon can see http://supervisord.org/
- how get config
$namespace = 'application'; $key = 'host'; $host = Apollo::connect($namespace)->get($key);
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-14