ConfigProvider.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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\ServiceGovernance;
  12. use Hyperf\Contract\IPReaderInterface;
  13. use Hyperf\ServiceGovernance\Listener\RegisterServiceListener;
  14. use Hyperf\Support\IPReader;
  15. class ConfigProvider
  16. {
  17. public function __invoke(): array
  18. {
  19. return [
  20. 'dependencies' => [
  21. IPReaderInterface::class => IPReader::class,
  22. ],
  23. 'listeners' => [
  24. RegisterServiceListener::class,
  25. ],
  26. 'publish' => [
  27. [
  28. 'id' => 'config',
  29. 'description' => 'The config of service governance.',
  30. 'source' => __DIR__ . '/../publish/services.php',
  31. 'destination' => BASE_PATH . '/config/autoload/services.php',
  32. ],
  33. ],
  34. ];
  35. }
  36. }