Download the PHP package dbtlr/php-env-builder without Composer
On this page you can find all versions of the php package dbtlr/php-env-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-env-builder
PHP Env Builder
Makes building .env files from the command-line simple.
For loading and using .env files in your development workflow, I highly suggest looking to the vlucas/phpdotenv package, which helps abstract out the process of loading environmental variables. This library is designed to help you build a local .env library that you can add to your .gitignore file, without the extra .env.example file that most people add to document how to build it.
Installation
The recommended method of installing this library is via Composer.
Run the following command from your project root:
Usage as a Composer Script
Because Composer provides its own way of working with the console IO, the extra.php-env-builder
config is the proper way of setting up your questions and variable names in this use case.
In order to have your .env file built when you run composer install
or composer update
you should provide config similar to this:
All extra.php-env-builder
options
- questions - default: []
(required)
// An array of questions that contain at least thename
andprompt
elements. - envFile - default:
.env
// Either the absolute location or one that is relative to yourpackage.json
file. - clobber - default:
false
// Will an existing .env file be overwritten on build? - loadEnv - default:
false
// If an existing file is being clobbered, will it be loaded to provide defaults? - verbose - default:
false
// Extra output
General Usage
If you would like to roll your own script, the syntax itself is fairly straightforward.
Note: This is a less expected use case, since the console IO needs to be provided by Composer, in order for it to accept input from inside a Composer script. This may be useful if you want to run this instead from a Makefile or an npm run postinstall
Running tests?
All tests are run using PHPUnit. Make sure you have at least PHP 7.1 installed, as well as Composer.
To run tests, simply run:
Want to contribute?
All versions of php-env-builder with dependencies
league/climate Version ^3.4
composer/composer Version ^1.7
vlucas/phpdotenv Version ^2.5