2017 © Pedro Peláez
 

symfony-bundle env-providers-bundle

A collection of extensions to allow you to use symfony .env files easier

image

c0ntax/env-providers-bundle

A collection of extensions to allow you to use symfony .env files easier

  • Thursday, March 22, 2018
  • by c0ntax
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

env-providers-bundle

Some extra env providers to make using Symfony 3+ .env files not such a pain, (*1)

Introduction

<rant type="personal">I much prefer the old parameters.yml way of doing things as it was more flexible, but Symfony has decided to move to dotenv, so...</rant> This bundle adds in 'missing' ways to parse dotenv variables so that you can not hate it so much., (*2)

Installation

You know the score:, (*3)

composer require c0ntax/env-providers-bundle

And don't forget to add the following to your Kernel if you're not using Flex:, (*4)

    public function registerBundles()
    {
        $bundles = [
            // ...
            new C0ntax\EnvProvidersBundle\C0ntaxEnvProvidersBundle(),
            // ...
        ];
    }

Configuration

Currently, a little configuration-light, you can add the following:, (*5)

c0ntax_env_providers:
    array:
        return_null_if_empty: true # If the env variable = '' then return a null instead of an empty array

Usage

In your .env file, (*6)

ENV_VAR=this,that, other

and then in your configuration, (*7)

parameters:
    array_thing: '%env(array:ENV_VAR)%'

Err, that's it. array_thing now equals ['this', 'that', 'other'], (*8)

The Versions

22/03 2018
22/03 2018
22/03 2018

dev-release/0.1.1

dev-release/0.1.1 https://github.com/c0ntax/env-providers-bundle

A collection of extensions to allow you to use symfony .env files easier

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Dan Burzynski

config bundle symfony dotenv