Download the PHP package tekill/env-diff without Composer
On this page you can find all versions of the php package tekill/env-diff. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tekill/env-diff
More information about tekill/env-diff
Files in tekill/env-diff
Package env-diff
Short Description Check the difference between env files and actualize each other
License MIT
Informations about the package env-diff
EnvDiff
EnvDiff is tool to compare environment keys to find the difference between .env files and actualize them.
Installation
Manual running
Actualize variables
Compare .env
with .env.dist
and add missing variables to .env
file.
Compare .env
with .env.example
and add missing variables to .env
file.
Compare .env-target
with .env.example
and add missing variables to .env-target
file.
If you want to delete outdated values just run command with -k=false
option.
Show differences
Command has same interface, arguments and options.
Compare .env
with .env.dist
and show differences between them.
Composer script
Add code block in composer.json
:
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 variables.
By default, the dist file is assumed to be in the same place than the target .env
file, suffixed by .dist
. This can be changed in the configuration:
The script handler will ask you interactively for variables which are missing
in the target env file, using the value of the dist file as default value.
If composer is run in a non-interactive mode --no-interaction
, the values of the dist file
will be used for missing variables.
Warning: This handler will overwrite any comments or spaces into your target .env
file so handle with care.
Managing multiple ignored files
The handler can manage multiple ignored files. To use this feature, the lf-env-diff
extra should contain a
JSON array with multiple configurations inside it instead of a configuration object:
Show difference
Add code block in composer.json
:
This handler has same behavior as described before.
Git hooks
You can use Git hook that gets triggered after any 'git pull' whenever one of the files specified has changed. Useful to update any web application dependency or sync configuration.
Create post-merge
hook in .git/hooks
directory of your project: