PHPackages                             incenteev/dynamic-parameters-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. incenteev/dynamic-parameters-bundle

Abandoned → [symfony/dependency-injection](/?search=symfony%2Fdependency-injection)ArchivedLibrary[Utility &amp; Helpers](/categories/utility)

incenteev/dynamic-parameters-bundle
===================================

Runtime retrieval of parameters from environment variables for Symfony

4210.5k8PHP

Since Apr 30Pushed 9y ago6 watchersCompare

[ Source](https://github.com/Incenteev/DynamicParametersBundle)[ Packagist](https://packagist.org/packages/incenteev/dynamic-parameters-bundle)[ RSS](/packages/incenteev-dynamic-parameters-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

DynamicParametersBundle
=======================

[](#dynamicparametersbundle)

This bundle provides a way to read parameters from environment variables at runtime. The value defined in the container parameter is used as fallback when the environment variable is not available.

[![Build Status](https://camo.githubusercontent.com/3c6d088ee799db893e765808154a5f208732e1c903e07f74e900bcd4ef21e942/68747470733a2f2f7472617669732d63692e6f72672f496e63656e746565762f44796e616d6963506172616d657465727342756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Incenteev/DynamicParametersBundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/37f8215adc6cba843b70ff9524d3eae7b7099a48328a32f82774b276cab6588c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e63656e746565762f44796e616d6963506172616d657465727342756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Incenteev/DynamicParametersBundle/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/c812df926822d5aecd9c30a7e0aea10866dce6e8146b63b01e845a9169252f08/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f496e63656e746565762f44796e616d6963506172616d657465727342756e646c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Incenteev/DynamicParametersBundle/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/89402c4beb96fc7150e7dc05aa52a79130e39e56be0a56828f22e07d53730c1d/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32653937626436622d376165382d343164312d623061372d6133313036663231633530642f6d696e692e706e67)](https://insight.sensiolabs.com/projects/2e97bd6b-7ae8-41d1-b0a7-a3106f21c50d)[![Latest Stable Version](https://camo.githubusercontent.com/4cfa63254cf62f88d4d6aa71d1f9a7b8aecf3b1b00e33e6cc91af7b3ebd9d468/68747470733a2f2f706f7365722e707567782e6f72672f696e63656e746565762f64796e616d69632d706172616d65746572732d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/incenteev/dynamic-parameters-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/181378896f1f9226aea6134f1f8e4f5fcf1121f8446ed157ef1e1a224fe2feff/68747470733a2f2f706f7365722e707567782e6f72672f696e63656e746565762f64796e616d69632d706172616d65746572732d62756e646c652f762f756e737461626c652e737667)](https://packagist.org/packages/incenteev/dynamic-parameters-bundle)[![License](https://camo.githubusercontent.com/a2bba9060f038a1f75d85dc392e99c7fbb951aa239f40d535532ae6baa9f9f6f/68747470733a2f2f706f7365722e707567782e6f72672f696e63656e746565762f64796e616d69632d706172616d65746572732d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/incenteev/dynamic-parameters-bundle)

Installation
------------

[](#installation)

Installation is a quick (I promise!) 2 step process:

1. Download IncenteevDynamicParametersBundle
2. Enable the bundle

### Step 1: Install IncenteevDynamicParametersBundle with composer

[](#step-1-install-incenteevdynamicparametersbundle-with-composer)

Run the following composer require command:

```
$ composer require incenteev/dynamic-parameters-bundle
```

### Step 2: Enable the bundle

[](#step-2-enable-the-bundle)

Finally, enable the bundle in the kernel:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Incenteev\DynamicParametersBundle\IncenteevDynamicParametersBundle(),
    );
}
```

Usage
-----

[](#usage)

Define the map of parameter names with the environment variable used to configure them.

```
# app/config/config.yml
incenteev_dynamic_parameters:
    parameters:
        database_host: DATABASE_HOST
        "database.name": DATABASE_NAME
```

Environment variables are always strings. To be able to set parameters of other types, the bundle supports parsing the environment variable as inline Yaml:

```
# app/config/config.yml
incenteev_dynamic_parameters:
    parameters:
        use_ssl:
            variable: HAS_SSL
            yaml: true
```

### ParameterHandler integration

[](#parameterhandler-integration)

If you are using the [env-map feature of the Incenteev ParameterHandler](https://github.com/Incenteev/ParameterHandler/#using-environment-variables-to-set-the-parameters), you can import the whole env-map very easily:

```
# app/config/config.yml
incenteev_dynamic_parameters:
    import_parameter_handler_map: true
    parameters:
        something_else: NOT_IN_THE_COMPOSER_JSON
```

The ParameterHandler parses the environment variables as inline Yaml, so the Yaml parsing is automatically enabled for these variables when importing the map.

> Note: Any parameter defined explicitly will win over the imported map.

By default, the bundle will look for the composer.json file in `%kernel.root_dir%/../composer.json`. If you use a non-standard location for your kernel, you can change the path to your composer.json file to read the env-map:

```
# app/config/config.yml
incenteev_dynamic_parameters:
    import_parameter_handler_map: true
    composer_file: path/to/composer.json
```

### Retrieving parameters at runtime

[](#retrieving-parameters-at-runtime)

The bundle takes care of service arguments, but changing the behavior of `$container->getParameter()` is not possible. However, it exposes a service to get parameters taking the environment variables into account.

```
$this->get('incenteev_dynamic_parameters.retriever')->get('use_ssl');
```

Limitations
-----------

[](#limitations)

- Getting a parameter from the container directly at runtime will not use the environment variable
- Parameters or arguments built by concatenating other parameters together will not rely on the environment variables (yet)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/75c5d927b0434111db9720dd78af8c83385cf28bb9aeafd031ba8cb0c4ffc558?d=identicon)[Stof](/maintainers/Stof)

---

Top Contributors

[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (9 commits)")[![chadburrus](https://avatars.githubusercontent.com/u/221522?v=4)](https://github.com/chadburrus "chadburrus (1 commits)")[![stanlemon](https://avatars.githubusercontent.com/u/86314?v=4)](https://github.com/stanlemon "stanlemon (1 commits)")

---

Tags

bundleenvironment-variablesphpsymfonysymfony-bundle

### Embed Badge

![Health badge](/badges/incenteev-dynamic-parameters-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/incenteev-dynamic-parameters-bundle/health.svg)](https://phpackages.com/packages/incenteev-dynamic-parameters-bundle)
```

###  Alternatives

[regularjack/frontend-bundle

A modern frontend development workflow for Symfony apps

3122.6k](/packages/regularjack-frontend-bundle)[thetispro/laravel5-setting

Persistent configuration settings for Laravel 5 - Create, Read, Update and Delete settings stored in files using JSON

289.7k](/packages/thetispro-laravel5-setting)[umpirsky/list-generator

Export data to various formats.

219.0k6](/packages/umpirsky-list-generator)[rikudou/memoize-bundle

Automatic memoization for your Symfony services

222.5k](/packages/rikudou-memoize-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
