config_center.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare (strict_types = 1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. use Hyperf\ConfigApollo\PullMode;
  12. use Hyperf\ConfigCenter\Mode;
  13. use function Hyperf\Support\env;
  14. return [
  15. 'enable' => (bool) env('CONFIG_CENTER_ENABLE', false),
  16. 'driver' => env('CONFIG_CENTER_DRIVER', 'apollo'),
  17. 'mode' => env('CONFIG_CENTER_MODE', Mode::PROCESS),
  18. 'drivers' => [
  19. 'apollo' => [
  20. 'driver' => Hyperf\ConfigApollo\ApolloDriver::class,
  21. 'pull_mode' => PullMode::INTERVAL,
  22. 'server' => 'http://127.0.0.1:9080',
  23. 'appid' => 'test',
  24. 'cluster' => 'default',
  25. 'namespaces' => [
  26. 'application',
  27. ],
  28. 'interval' => 5,
  29. 'strict_mode' => false,
  30. 'client_ip' => current(swoole_get_local_ip()),
  31. 'pullTimeout' => 10,
  32. 'interval_timeout' => 1,
  33. ],
  34. ],
  35. ];