\Yesf\Config\AdapterApollo

Apllo adapter

Using: new Apllo([ 'host' => '127.0.0.1', 'port' => 80, 'path' => '', 'appid' => '123456' 'cluster' => 'default', 'namespace' => '1,2,3', 'with_ip' => false, 'with_ip' => '192.168.0.0/24' ])

Summary

Methods
Properties
Constants
__construct()
refresh()
get()
has()
No public properties found
No constants found
getClient()
update()
$conf
$cache
$last_fetch
$last_key
N/A
No private methods found
No private properties found
N/A

Properties

$conf

$conf : array

Type

array — Apollo Config

$cache

$cache : array

Type

array — Config cache

$last_fetch

$last_fetch : integer

Type

integer — Last update time

$last_key

$last_key : array

Type

array — Last key returned by Apollo

Methods

__construct()

__construct(\Yesf\Config\Adapter\array/string  $conf) 

Constructor

Parameters

\Yesf\Config\Adapter\array/string $conf

Apollo config

refresh()

refresh(boolean  $force = false) 

Refresh all configs

Parameters

boolean $force

Is force refresh or not

get()

get(string  $key, mixed  $default = null) : mixed

获取配置

Parameters

string $key

形似a.b.c的key

mixed $default

默认

Returns

mixed

has()

has(string  $key) : boolean

检查配置是否存在

Parameters

string $key

形似a.b.c的key

Returns

boolean

getClient()

getClient(string  $namespace) : object

Get HTTP Client

Parameters

string $namespace

Returns

object

update()

update(string  $namespace, array  $config) 

Update cache with result

Parameters

string $namespace
array $config