secrets.php 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Bundle\FrameworkBundle\Secrets\DotenvVault;
  12. use Symfony\Bundle\FrameworkBundle\Secrets\SodiumVault;
  13. return static function (ContainerConfigurator $container) {
  14. $container->services()
  15. ->set('secrets.vault', SodiumVault::class)
  16. ->args([
  17. abstract_arg('Secret dir, set in FrameworkExtension'),
  18. service('secrets.decryption_key')->ignoreOnInvalid(),
  19. ])
  20. ->tag('container.env_var_loader')
  21. ->set('secrets.decryption_key')
  22. ->parent('container.env')
  23. ->args([abstract_arg('Decryption env var, set in FrameworkExtension')])
  24. ->set('secrets.local_vault', DotenvVault::class)
  25. ->args([abstract_arg('.env file path, set in FrameworkExtension')])
  26. ;
  27. };