Download the PHP package yarco/phpdotenv-generator without Composer
On this page you can find all versions of the php package yarco/phpdotenv-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yarco/phpdotenv-generator
More information about yarco/phpdotenv-generator
Files in yarco/phpdotenv-generator
Package phpdotenv-generator
Short Description a tool for managing .env file which is a common config solution nowadays
License MIT
Informations about the package phpdotenv-generator
PHP DotEnv Generator
This is a tool for generating .env
file which is a very common solution for configuration. What's phpdotenv?
Phpdotenv package is used in several php frameworks. Ex.:laravel. When dotenv is working, it requires a config file .env
(or you can set those shell constants by hand, but it is obviously not handy enough, ex.: if you are going to add API_PREFIX=api
which is a common situation you are doing REST app).
And also, in nowadays, everything is working in an automatic way. So this repository is taking care of those .env
files.
Use Case
There is a laravel
project you've done. And now you are going to deploy it into several cloud servers. Of course, it is easy by pulling down the source through git...Then what about the .env
files?
Of cause you can copy and modify your local one then upload it, but it is not very handy, no?
So you add some config in your project's composer.json
file like this:
Then you add a .env.ini
like normal ini
file. (Whether you put the .env.ini
into git repository is controlled by you).
The ini
file's content may be as the following:
So, if you want to generate dev
environment config, you just type PHPDOTENV=dev phpdotenv .
. And even handy, you can also config composer to run the install for you.
Of cause, in this case, you should composer require yarco/phpdotenv-generator
this package first.
Extra Features
- if
"warning":true
, it will generate warning messages into sys log - you can use
projects
to deal with lots projects