PHPackages                             linio/composer-parameter-handler - 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. linio/composer-parameter-handler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

linio/composer-parameter-handler
================================

Composer script handling your ignored parameter file

3.0.3(6y ago)158311MITPHPPHP &gt;=5.6CI failing

Since Apr 6Pushed 6y ago2 watchersCompare

[ Source](https://github.com/LinioIT/ParameterHandler)[ Packagist](https://packagist.org/packages/linio/composer-parameter-handler)[ Docs](https://github.com/LinioIT/ParameterHandler)[ RSS](/packages/linio-composer-parameter-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (9)Used By (1)

Composer-driven parameter management
====================================

[](#composer-driven-parameter-management)

This tool allows you to manage your application parameters when running a composer install or update. It works when storing the parameters in a config file under a single top-level key (named `parameters` by default). Other keys are copied without change.

[![Build Status](https://camo.githubusercontent.com/14a0e93280846f39a71dd74c5af0ce0281a9f212603c835f5a658bd03259439d/68747470733a2f2f7472617669732d63692e6f72672f4c696e696f49542f506172616d6574657248616e646c65722e706e67)](https://travis-ci.org/LinioIT/ParameterHandler)[![Code Coverage](https://camo.githubusercontent.com/f068715b5b4871e5bd63e84866a474b10cf55f526cab57e9ff1a860b4bd6aad9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c696e696f49542f506172616d6574657248616e646c65722f6261646765732f636f7665726167652e706e673f733d65613564653238643937363466646362366135373661343165323434633061633533376233633831)](https://scrutinizer-ci.com/g/LinioIT/ParameterHandler/)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/772dbe0a9f87ae9c144625f768749c0d588e05e798db8b47eb8fdfd3c91c3967/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4c696e696f49542f506172616d6574657248616e646c65722f6261646765732f7175616c6974792d73636f72652e706e673f733d36313433643934356262646661633563313131346434666535643066346565373337646231386266)](https://scrutinizer-ci.com/g/LinioIT/ParameterHandler/)[![Latest Stable Version](https://camo.githubusercontent.com/51c688d1151d075466d0601242079b93796c763e637ffd5049961ecd7cf9fdb4/68747470733a2f2f706f7365722e707567782e6f72672f6c696e696f2f636f6d706f7365722d706172616d657465722d68616e646c65722f762f737461626c652e706e67)](https://packagist.org/packages/linio/composer-parameter-handler)[![Latest Unstable Version](https://camo.githubusercontent.com/6441539b9d022e7718caa944efdc0ec8bd7963ba379f1de46dd27d6b1ac90af1/68747470733a2f2f706f7365722e707567782e6f72672f6c696e696f2f636f6d706f7365722d706172616d657465722d68616e646c65722f762f756e737461626c652e706e67)](https://packagist.org/packages/linio/composer-parameter-handler)

Usage
-----

[](#usage)

Add the following in your root composer.json file:

```
{
    "require": {
        "linio/composer-parameter-handler": "~3.0"
    },
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
        ]
    },
    "extra": {
        "incenteev-parameters": {
            "file": "app/config/parameters.yml",
            "file-type": "yml"
        }
    }
}
```

The `app/config/parameters.yml` will then be created or updated by the composer script, to match the structure of the dist file `app/config/parameters.yml.dist`by asking you the missing parameters.

By default, the dist file is assumed to be in the same place than the parameters file, suffixed by `.dist`. This can be changed in the configuration:

```
{
    "extra": {
        "incenteev-parameters": {
            "file": "app/config/parameters.yml",
            "file-type": "yml",
            "dist-file": "some/other/folder/to/other/parameters/file/parameters.yml.dist"
        }
    }
}
```

The script handler will ask you interactively for parameters which are missing in the parameters file, using the value of the dist file as default value. All prompted values are parsed as inline Yaml, to allow you to define `true`, `false`, `null` or numbers easily. If composer is run in a non-interactive mode, the values of the dist file will be used for missing parameters.

**Warning:** This parameters handler will overwrite any comments or spaces into your parameters.yml file so handle with care. If you want to give format and comments to your parameter's file you should do it on your dist version.

### Keeping outdated parameters

[](#keeping-outdated-parameters)

Warning: This script removes outdated params from `parameters.yml` which are not in `parameters.yml.dist`If you need to keep outdated params you can use `keep-outdated` param in the configuration:

```
{
    "extra": {
        "incenteev-parameters": {
            "keep-outdated": true
        }
    }
}
```

### Using a different top-level key

[](#using-a-different-top-level-key)

The script handler looks for a `parameters` key in your dist file. You can change this by using the `parameter-key` param in the configuration:

```
{
    "extra": {
        "incenteev-parameters": {
            "parameter-key": "config"
        }
    }
}
```

### Using environment variables to set the parameters

[](#using-environment-variables-to-set-the-parameters)

For your prod environment, using an interactive prompt may not be possible when deploying. In this case, you can rely on environment variables to provide the parameters. This is achieved by providing a map between environment variables and the parameters they should fill:

```
{
    "extra": {
        "incenteev-parameters": {
            "env-map": {
                "my_first_param": "MY_FIRST_PARAM",
                "my_second_param": "MY_SECOND_PARAM",
                "my.nested.param": "MY_NESTED_PARAM",
            }
        }
    }
}
```

If an environment variable is set, its value will always replace the value set in the existing parameters file.

As environment variables can only be strings, they are also parsed as inline Yaml values to allows specifying `null`, `false`, `true` or numbers easily.

### Renaming parameters

[](#renaming-parameters)

If you are renaming a parameter, the new key will be set according to the usual routine (prompt if possible, use environment variables, use default). To have the parameters handler use the value of an (obsolete) parameter, specify a rename-map:

```
{
    "extra": {
        "incenteev-parameters": {
            "rename-map": {
                "new_param_1": "old_param_1",
                "new_param_2": "old_param_2"
            }
        }
    }
}
```

This will create the new parameters new\_param\_1 and new\_param\_2 while using the values from old\_param\_1 and old\_param\_2, respectively. It will not remove the old parameters unless you've also removed them from the dist version.

If the old parameter is no longer present (maybe because it has been renamed and removed already), no parameters are overwritten. You don't need to remove obsolete parameters from the rename map once they have been renamed.

### Managing multiple ignored files

[](#managing-multiple-ignored-files)

The parameter handler can manage multiple ignored files. To use this feature, the `incenteev-parameters` extra should contain a JSON array with multiple configurations inside it instead of a configuration object:

```
{
    "extra": {
        "incenteev-parameters": [
            {
                "file": "app/config/parameters.yml",
                "file-type": "yml",
                "env-map": {}
            },
            {
                "file": "app/config/databases.yml",
                "file-type": "yml",
                "dist-file": "app/config/databases.dist.yml",
                "parameter-key": "config"
            }
        ]
    }
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 55.4% 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.

###  Release Activity

Cadence

Every ~362 days

Recently: every ~437 days

Total

8

Last Release

2253d ago

Major Versions

v1.0.0 → v2.0.02013-04-06

v2.1.1 → 3.0.02015-07-23

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.3

3.0.1PHP ~5.4

3.0.2PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9ba9a1e115b27dbff7b98800fad30327f99bef227202e72fa896b1780440692?d=identicon)[linio](/maintainers/linio)

---

Top Contributors

[![stof](https://avatars.githubusercontent.com/u/439401?v=4)](https://github.com/stof "stof (56 commits)")[![klaussilveira](https://avatars.githubusercontent.com/u/467729?v=4)](https://github.com/klaussilveira "klaussilveira (14 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (7 commits)")[![richsage](https://avatars.githubusercontent.com/u/231551?v=4)](https://github.com/richsage "richsage (3 commits)")[![alcaeus](https://avatars.githubusercontent.com/u/383198?v=4)](https://github.com/alcaeus "alcaeus (2 commits)")[![franmomu](https://avatars.githubusercontent.com/u/720690?v=4)](https://github.com/franmomu "franmomu (2 commits)")[![igorzoriy](https://avatars.githubusercontent.com/u/535694?v=4)](https://github.com/igorzoriy "igorzoriy (2 commits)")[![ivan1986](https://avatars.githubusercontent.com/u/156418?v=4)](https://github.com/ivan1986 "ivan1986 (2 commits)")[![lsmith77](https://avatars.githubusercontent.com/u/300279?v=4)](https://github.com/lsmith77 "lsmith77 (2 commits)")[![rybakit](https://avatars.githubusercontent.com/u/533861?v=4)](https://github.com/rybakit "rybakit (2 commits)")[![h4cc](https://avatars.githubusercontent.com/u/2981491?v=4)](https://github.com/h4cc "h4cc (1 commits)")[![sgilberg](https://avatars.githubusercontent.com/u/669465?v=4)](https://github.com/sgilberg "sgilberg (1 commits)")[![lucascourot](https://avatars.githubusercontent.com/u/938375?v=4)](https://github.com/lucascourot "lucascourot (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![rgazelot](https://avatars.githubusercontent.com/u/1488251?v=4)](https://github.com/rgazelot "rgazelot (1 commits)")[![felipegirotti](https://avatars.githubusercontent.com/u/1295097?v=4)](https://github.com/felipegirotti "felipegirotti (1 commits)")[![elnur](https://avatars.githubusercontent.com/u/821060?v=4)](https://github.com/elnur "elnur (1 commits)")[![j-d](https://avatars.githubusercontent.com/u/1140726?v=4)](https://github.com/j-d "j-d (1 commits)")[![jordillonch](https://avatars.githubusercontent.com/u/601782?v=4)](https://github.com/jordillonch "jordillonch (1 commits)")

---

Tags

parameters management

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linio-composer-parameter-handler/health.svg)

```
[![Health](https://phpackages.com/badges/linio-composer-parameter-handler/health.svg)](https://phpackages.com/packages/linio-composer-parameter-handler)
```

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[diarmuidie/envpopulate

Tool to interactively populate a `.env` file based on an `.env.example` file whenever Composer installs or updates.

1892.0k](/packages/diarmuidie-envpopulate)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

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