incenteev/composer-parameter-handler
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
symfony/yaml | v6.4.7 | - | MIT | prod |
The "incenteev/composer-parameter-handler" is a composer script that facilitates the management of parameter files which often get ignored during a composer install or update operation. Ideal for settings stored in a Yaml file under a top-level key (conventionally named "parameters"), this tool ensures smooth management and alignment of these parameters.
Using the incenteev/composer-parameter-handler is quite straightforward. Start by adding it to the "require" section of your root composer.json file.
Here's a simple code snippet:
{
"require": {
"incenteev/composer-parameter-handler": "~2.0"
},
"scripts": {
"post-install-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
],
"post-update-cmd": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters"
]
},
"extra": {
"incenteev-parameters": {
"file": "app/config/parameters.yml"
}
}
}
In the above example, "app/config/parameters.yml" will be created or updated by the composer script, in line with the structure of the dist file "app/config/parameters.yml.dist".
The script handler will interactively ask you for parameters missing in this file, using the dist file's values as default. If composer is run in a non-interactive mode, the dist file's values will be used for missing parameters.
Please, bear in mind that this parameter handler will overwrite any comments or spaces in your parameters.yml file, so handle it with caution. Document your parameter's file in the dist version if you want to maintain clarity and readability.
The official documentation for the incenteev/composer-parameter-handler tool can be found on its GitHub page at https://github.com/Incenteev/ParameterHandler. This page provides extensive information about the package, including its usage instructions, default assumptions, configuration options, and handling multiple ignored files.