group-co / php-apollo
apollo php cilent.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 1
Open Issues: 0
Type:project
Requires
- php: >=5.3
This package is auto-updated.
Last update: 2024-10-29 05:28:50 UTC
README
环境依赖
- php > 5.3
- swoole
composer安装
composer require group-co/php-apollo
使用
<?php
use Group\ApolloConfig;
require 'vendor/autoload.php';
$config = new ApolloConfig("http://localhost:8080", "groupco");
//每2秒轮询一次
$config->poll(2);
swoole_timer_tick(1000, function () use ($config) {
$val = $config->get("application", "environment1", "2");
var_dump($val);
});