PHP code example of church / apollo-client
1. Go to this page and download the library: Download church/apollo-client library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
church / apollo-client example snippets
$client = new Client('http://127.0.0.1:8082', 'appid', 'tech.oss', 'app secret');
$result = $client->getFromCache();
$result = $client->getWithoutCache();
//必须在CLI模式下运行
$client->autoPull(['tech.oss', 'tech.baidu', 'tech.sms'], function($configuration) {
$configuration = json_decode($configuration, true);
$this->assertTrue(boolval($configuration));
});