hellofresh/composer-parameter-handler

This package is abandoned and no longer maintained. No replacement package was suggested.

Composer script handling your ignored parameter file

1.0.0 2016-02-15 13:50 UTC

This package is not auto-updated.

Last update: 2016-05-07 23:47:26 UTC


README

Latest Stable Version Latest Unstable Version

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

Usage

Add the following in your root composer.json file:

{
    "require": {
        "hellofresh/composer-parameter-handler": "~1.0"
    },
    "scripts": {
        "post-install-cmd": [
            "HelloFresh\\ParameterHandler\\ScriptHandler::buildParameters"
        ],
        "post-update-cmd": [
            "HelloFresh\\ParameterHandler\\ScriptHandler::buildParameters"
        ]
    },
    "extra": {
        "dotenv": {
            "file": ".env"
        }
    }
}

The .env will then be created or updated by the composer script, to match the structure of the dist file .env.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": ".env",
            "dist-file": ".env.dist"
        }
    }
}