Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;

/**
Expand All @@ -44,6 +45,10 @@ public function load(array $config, ContainerBuilder $container)
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config'));
$loader->load('services.yml');

if (class_exists(EnvVarProcessorInterface::class)) {
$loader->load('env_var.yml');
}

if (true === $container->getParameter('kernel.debug')) {
$loader->load('dev_services.yml');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
final class KeyEnvVarProcessor implements EnvVarProcessorInterface
{
/**
* {@inheritdoc}
*/
public function getEnv($prefix, $name, \Closure $getEnv)
{
$env = $getEnv($name);
Expand All @@ -35,6 +38,9 @@ public function getEnv($prefix, $name, \Closure $getEnv)
}
}

/**
* {@inheritdoc}
*/
public static function getProvidedTypes()
{
return [
Expand Down
9 changes: 9 additions & 0 deletions src/Bundle/JoseFramework/Resources/config/env_var.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false

Jose\Bundle\JoseFramework\EnvVarProcessor\:
resource: '../../EnvVarProcessor'
tags: ['container.env_var_processor']
4 changes: 0 additions & 4 deletions src/Bundle/JoseFramework/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ services:
public: false

Jose\Component\Core\AlgorithmManagerFactory: ~

Jose\Bundle\JoseFramework\EnvVarProcessor\:
resource: '../../EnvVarProcessor'
tags: ['container.env_var_processor']