title: Apollo configuration center meta:

  • name: description content: EasySwoole Apollo configuration center
  • name: keywords content: swoole|swoole extension|swoole framework|easyswoole|apollo

Apollo configuration center

EasySwoole supports apollo data center. Synchronization can be configured according to this component.

apollo

Installation

  1. composer require easyswoole/apollo

Use

  1. go(function (){
  2. //Configure apollo server information
  3. $server = new \EasySwoole\Apollo\Server([
  4. 'server'=>'http://106.12.25.204:8080',
  5. 'appId'=>'easyswoole'
  6. ]);
  7. //Create an apollo client
  8. $apollo = new \EasySwoole\Apollo\Apollo($server);
  9. //First sync
  10. var_dump( $apollo->sync('mysql'));
  11. //The second synchronization, if the server has not changed, then the result returned, isModify marked as fasle, with lastReleaseKey
  12. var_dump( $apollo->sync('mysql'));
  13. });

::: warning Can start a timer in the process to achieve automatic timing update :::