Download the PHP package yannoff/composer-dotenv-handler without Composer

On this page you can find all versions of the php package yannoff/composer-dotenv-handler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-dotenv-handler

yannoff/composer-dotenv-handler

Latest Stable Version Total Downloads License

Composer script to handle .env file maintenance, based upon the concept of the popular incenteev/composer-parameter-handler package.

Usage

First you must require the package:

Then, set up your composer.json accordingly, as in the following example:

Advanced options

Options may be passed via the extra section of the composer.json :

Available options

Name Default value Description
file .env The name of the auto-generated dotenv file
dist-file .env.dist The name of the template file (the dist file)
keep-outdated true Keep values in the env file that are not anymore in the dist file
behavior normal If set to flex, enable support for Symfony Flex applications (see next section for details)

Symfony Flex Behavior

As of November 2018, the guys at Symfony decided to change radically how dotenv files are handled in symfony applications.

A local temporary workaround could be to modify the composer.json extra section as follow:

Anyway this is not an acceptable solution, indeed the dotenv file name may vary from one deploy environment to another (test, staging, prod...): the composer.json can't be committed as is.

So here comes the behavior option:

When in flex behavior mode, the script will build the dotenv file name automatically, based upon either the APP_ENV or ENV (in this order of preference) environment variable (will use local as default value, if not set) at runtime.

For example, issuing the following command in a terminal:

would result in having the following config values:

Licence

Licensed under the MIT Licence.


All versions of composer-dotenv-handler with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6|>=7.0.8
symfony/dotenv Version >=3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yannoff/composer-dotenv-handler contains the following files

Loading the files please wait ....