seffeng / nacos
PHP extension nacos
Installs: 1 191
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.3
- guzzlehttp/guzzle: >=6.4
- monolog/monolog: >=1.0
Requires (Dev)
- phpunit/phpunit: >=6.0
README
安装
# 安装
$ composer require seffeng/nacos
目录说明
├───src
│ │ Nacos.php
│ ├───Exceptions
│ │ NacosException.php
│ └───Handlers
│ Configs.php
│ Instances.php
│ Log.php
├───tests
│ NacosConfig.php
│ NacosInstance.php
示例
/** * Test */ class NacosConfig { /** * 获取配置 */ public function testGet() { try { $conf = $this->getConfig()->getConfig(); var_dump($conf); } catch (\Exception $e) { throw $e; } } /** * 监听配置 */ public function testListener() { try { $conf = $this->getConfig()->listenerConfig(); var_dump($conf); } catch (\Exception $e) { throw $e; } } private function getConfig() { $host = 'http://nacos.io'; $nacos = new Nacos($host, 'nacos', 'nacos'); $config = new Configs($nacos, 'test-01'); return $config; } }
方法
项目依赖
备注
1、更多示例请参考 tests 目录下测试文件;