ConfigProvider.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. namespace Hyperf\ConfigCenter;
  12. use Hyperf\ConfigCenter\Listener\CreateMessageFetcherLoopListener;
  13. use Hyperf\ConfigCenter\Listener\FetchConfigOnBootListener;
  14. use Hyperf\ConfigCenter\Listener\OnPipeMessageListener;
  15. use Hyperf\ConfigCenter\Process\ConfigFetcherProcess;
  16. class ConfigProvider
  17. {
  18. public function __invoke(): array
  19. {
  20. return [
  21. 'dependencies' => [
  22. ],
  23. 'commands' => [
  24. ],
  25. 'processes' => [
  26. ConfigFetcherProcess::class,
  27. ],
  28. 'listeners' => [
  29. FetchConfigOnBootListener::class,
  30. CreateMessageFetcherLoopListener::class,
  31. OnPipeMessageListener::class,
  32. ],
  33. 'publish' => [
  34. [
  35. 'id' => 'config-center',
  36. 'description' => 'The configuration file for config center.',
  37. 'source' => __DIR__ . '/../publish/config_center.php',
  38. 'destination' => BASE_PATH . '/config/autoload/config_center.php',
  39. ],
  40. ],
  41. ];
  42. }
  43. }