Download the PHP package nbgrp/env-bundle without Composer
On this page you can find all versions of the php package nbgrp/env-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nbgrp/env-bundle
More information about nbgrp/env-bundle
Files in nbgrp/env-bundle
Package env-bundle
Short Description The bundle provides a few useful custom Symfony Environment Variable processors
License BSD-3-Clause
Informations about the package env-bundle
Symfony Environment Variable Processors
Overview
The bundle provides a few useful custom Symfony Environment Variable processors:
- Array Cast processor for array values type casting.
- CSV processor with customizable delimiter.
Installation / Configuration
Enable the bundle in config/bundles.php
:
All Environment Variable processors disabled by default. You should enable the required processors explicitly through the bundle config.
YAML config example:
PHP config example (for Symfony 5+):
Processors
ArrayCastEnvVarProcessor
Performs type casting of the env value to the one of the supported types:
- bool
- int
- float
- string
nb: If the csv value is not an array it will be casted to an array.
Example:
CsvEnvVarProcessor
Parses the env value into array. Unlike build-in csv
processor, this one supports customization of
the delimiter.
To use the CSV processor it should be configured: see config example how to specify available delimiters (and so env prefixes).
nb: Do not use backslash
\
for escaping double quote"
enclosure character (on PHP ^7.4 it will not work). For escape"
just write it twice.
Example:
All versions of env-bundle with dependencies
ext-filter Version *
symfony/config Version ^7
symfony/dependency-injection Version ^7
symfony/http-kernel Version ^7