2017 © Pedro PelĂĄez
 

symfony-bundle di-env-loader-bundle

image

bartlomiejbeta/di-env-loader-bundle

  • Tuesday, November 28, 2017
  • by bartlomiejbeta
  • Repository
  • 2 Watchers
  • 0 Stars
  • 222 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

DIEnvLoaderBundle

Easily load kernel environment dependent config files., (*1)

instalation

composer require bartlomiejbeta/di-env-loader-bundle

usage

simple

class ExampleExtension extends Extension
{
  use DIEnvLoaderTrait;

  public function load(array $configs, ContainerBuilder $container)
  {
    $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

    self::loadByEnv($loader, $container, 'services', 'yml');
  }

}

configs will be load for all kernel environments. - for example for test environment file services-test.yml located in Resources/config (and so on for other environment), (*2)

configured

class ExampleExtension extends Extension
{
  use DIEnvLoaderTrait;

  public function load(array $configs, ContainerBuilder $container)
  {
    $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config/test'));

    if ('test' === self::getEnv($container))
    {
      self::loadByEnv($loader, $container, 'services', 'yml', '.');
    }
  }

}

configs will be load only for test kernel environment., (*3)

  • file services.test.yml located in Resources/config/test

The Versions

28/11 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

dependency injection env loader

27/11 2017

v0.0.1

0.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

dependency injection env loader