PHPackages                             datto/parameter-auto-env - 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. datto/parameter-auto-env

AbandonedArchivedComposer-plugin[Utility &amp; Helpers](/categories/utility)

datto/parameter-auto-env
========================

Composer plugin to add support for "env-map": "auto"

1.2.1(8y ago)22.0k1MITPHPPHP &gt;=5.3.3

Since Oct 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/datto/parameter-auto-env)[ Packagist](https://packagist.org/packages/datto/parameter-auto-env)[ Docs](http://datto.com)[ RSS](/packages/datto-parameter-auto-env/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Parameters auto-env
===================

[](#parameters-auto-env)

Composer plugin to add support for `"env-map": "auto"` to [Incenteev/ParameterHandler](https://github.com/Incenteev/ParameterHandler)

This allows for simple deployment when configuration values are set as environment variables on CI workers but not on development or production machines. Developers can continue with their original parameter workflow.

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

[](#installation)

`composer req datto/parameter-auto-env`

With the plugin installed you can now use the new configuration options inside of `extra.incenteev-parameters`:

- `"env-map": "auto"` to enable automatic mapping of environment variables to parameters for the file
- `"auto-env-prefix": ""` optional prefix for all environment variables (default "")
- `"auto-env-fullname": true` use full name for variable names, e.g. `parameters.database_host` instead of `database_host` (default true)

### Basic Example:

[](#basic-example)

```
"incenteev-parameters": {
    "file": "app/config/parameters.yml",
    "env-map": "auto"
}

```

### Usage with run-script:

[](#usage-with-run-script)

`"env-map": "auto"` will automatically apply to any Composer install or update events that include a call to `Incenteev/ParameterHandler`. However, to work during other events or manual script execution you must explicitly add the call to buildMap in your scripts object before the buildParameters call. e.g.

```
"scripts": {
    "update-parameters": [
        "Datto\\Composer\\ParameterAutoEnv\\AutoEnvPlugin::buildMap",
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
    ],
    "post-install-cmd": [
        "@update-parameters"
    ],
    "post-update-cmd": [
        "@update-parameters"
    ]
}

```

Execution will now function correctly when running `composer run-script update-parameters`

Environment variable names
--------------------------

[](#environment-variable-names)

Each parameter detected in configured files will attempt to be auto-set by a similarly named environment variable. These will be uppercase and any `.` is replaced with two `_`s. e.g:

- `parameters.secret_key` will expect `PARAMETERS__SECRET_KEY`
- `parameters.api-url` will expect `PARAMETERS__API-URL`
- `parameters.database.name` will expect `PARAMETERS__DATABASE__NAME`

The `composer auto-env-check` command can be run to check expected environment variable names.

Deployment environment
----------------------

[](#deployment-environment)

Environment variables are parsed as inline Yaml values and follow [standard behaviour in Incenteev/ParameterHandler](https://github.com/Incenteev/ParameterHandler#using-environment-variables-to-set-the-parameters)for env-map parameters.

This plugin supplies the composer command `composer auto-env-check` to ensure all parameters have a corresponding environment variables when run, returning 0 if successful and 1 if any are missing. This can be run in the test phase of your CI pipeline.

Mixed environment
-----------------

[](#mixed-environment)

All parameters in a file must be mapped automatically on deployment if any are. If exceptions are needed these should be placed in a separate file without the `"env-map": "auto"` setting, see: [Managing multiple ignored files](https://github.com/Incenteev/ParameterHandler#managing-multiple-ignored-files)

### Example:

[](#example)

```
"incenteev-parameters": [
    {
        "file": "app/config/parameters.yml"
    },
    {
        "file": "app/config/secrets.yml",
        "env-map": "auto"
    }
]

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 90% 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 ~33 days

Total

4

Last Release

3031d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb044681aa172ced7a03b093bda1f1f1031831133281d3d1e036807d28260c31?d=identicon)[datto-packagist-maintainer](/maintainers/datto-packagist-maintainer)

![](https://www.gravatar.com/avatar/7ab4859289fbfdce0a6a59676bbdabae783908a355d29383251e571ad38fc912?d=identicon)[choult](/maintainers/choult)

![](https://www.gravatar.com/avatar/3e312f52b9e39ccbb4d15e250fdafee8f1d967e0727c650c4475ddae07a61f8a?d=identicon)[leijou](/maintainers/leijou)

---

Top Contributors

[![leijou](https://avatars.githubusercontent.com/u/654651?v=4)](https://github.com/leijou "leijou (9 commits)")[![kcostagliola2](https://avatars.githubusercontent.com/u/25804561?v=4)](https://github.com/kcostagliola2 "kcostagliola2 (1 commits)")

---

Tags

envparameters managementenv-mapauto-env

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/datto-parameter-auto-env/health.svg)

```
[![Health](https://phpackages.com/badges/datto-parameter-auto-env/health.svg)](https://phpackages.com/packages/datto-parameter-auto-env)
```

###  Alternatives

[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)[ffraenz/private-composer-installer

A composer install helper for private packages

2331.7M5](/packages/ffraenz-private-composer-installer)[philippbaschke/acf-pro-installer

An install helper for Advanced Custom Fields PRO

283724.6k](/packages/philippbaschke-acf-pro-installer)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[altis/local-server

Local Server module for Altis

18208.4k2](/packages/altis-local-server)[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)

PHPackages © 2026

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