ConfigServiceProvider.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. /*
  8. * This file is part of the overtrue/wechat.
  9. *
  10. * (c) overtrue <i@overtrue.me>
  11. *
  12. * This source file is subject to the MIT license that is bundled
  13. * with this source code in the file LICENSE.
  14. */
  15. namespace ByteDance\Kernel\Providers;
  16. use ByteDance\Kernel\Config;
  17. use Pimple\Container;
  18. use Pimple\ServiceProviderInterface;
  19. /**
  20. * Class ConfigServiceProvider.
  21. *
  22. * @author overtrue <i@overtrue.me>
  23. */
  24. class ConfigServiceProvider implements ServiceProviderInterface
  25. {
  26. /**
  27. * Registers services on the given container.
  28. *
  29. * This method should only be used to configure services and parameters.
  30. * It should not get services.
  31. *
  32. * @param Container $pimple A container instance
  33. */
  34. public function register(Container $pimple)
  35. {
  36. $pimple['config'] = function ($app) {
  37. return new Config($app->getConfig());
  38. };
  39. }
  40. }