Download the PHP package romanzipp/laravel-env-normalizer without Composer
On this page you can find all versions of the php package romanzipp/laravel-env-normalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download romanzipp/laravel-env-normalizer
More information about romanzipp/laravel-env-normalizer
Files in romanzipp/laravel-env-normalizer
Package laravel-env-normalizer
Short Description Format .env files according to your .env.example structure to keep track of used and unused variables
License MIT
Informations about the package laravel-env-normalizer
Laravel Env Normalizer
Format .env
files according to your .env.example
structure to keep track of used and unused variables.
Why?
I like to keep a clear overview of all available environment variables by adding some default values to my version controled .env.example
file.
This packages helps with structuring your example files.
Contents
- Installation
- Usage
- Roadmap
- Testing
Installation
Usage
List all available options
Specify reference and target file(s)
Reference and target options are optional. If not specified the command will only look for a .env.example
(as reference) and .env
file (as target).
Automatically format all other .env files
This option will discover any other .env.*
files located in the base path and add them to the target list.
Create backup files
This will create a {name}.bak
backup file for each modified target file.
Dry run
Log the expected output to the console instead of writing it to the file.
Example normalization
.env.example |
previous .env |
new .env |
---|---|---|
BASE_URL=localhost |
DB_HOST=10.0.0.10 |
BASE_URL=me.com |
- The base structure for all target
.env
files will be taken from the reference.env.example
file - Values will be replaced with the existing content
- Unused (not overwritten) example variables will not be added
- Additional variables from the
.env
file will be appended to the bottom so you can later add them to your version controled example file - Commented lines
#FOO=bar
which do not start with hash + space#
will be appended to the end
Roadmap
- [ ] Detect similar variables and position them below existing ones (place
MAIL_FROM
belowMAIL_CONNECTION
instead of appendin it to the end)