Recommend this page to a friend! |
Classes of Murat Cileli | Papernic | vendor/incenteev/composer-parameter-handler/README.md | Download |
|
DownloadManaging your ignored parameters with ComposerThis tool allows you to manage your ignored parameters when running a composer
install or update. It works when storing the parameters in a Yaml file under
a single top-level key (named UsageAdd the following in your root composer.json file:
The By default, the dist file is assumed to be in the same place than the parameters
file, suffixed by
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 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 parametersWarning: This script removes outdated params from
Using a different top-level keyThe script handler looks for a
Using environment variables to set the parametersFor 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:
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 Renaming parametersIf 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:
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 filesThe parameter handler can manage multiple ignored files. To use this feature,
the
|