Download the PHP package prooxxy/magento2-dotenv without Composer
On this page you can find all versions of the php package prooxxy/magento2-dotenv. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download prooxxy/magento2-dotenv
More information about prooxxy/magento2-dotenv
Files in prooxxy/magento2-dotenv
Package magento2-dotenv
Short Description Adds support for .env files to Magento 2
License MIT
Informations about the package magento2-dotenv
Magento 2 .env module
Adds support for .env configuration files to Magento 2.
This module was created because Magento recommends injection of variables into $_ENV through the index.php file. I believe that is a stupid suggestion.
Installation
Use composer to install this.
Alternative installation
If you don't have the option to use composer it's possible to copy the root of this project into the app/code/PrOOxxy/DotEnv
folder of your magento installation
Make sure the module is enable before start using
Features
This module does only one thing once installed.
It reads and parses any variables that is locate inside $_ENV
array
It does this before Magento processes other environments variables. It does override any preexisting variable with the same name.
Usage
- Add .env into app/etc The file must have chmod level 0644 or below
- Follow the official devdocs instructions for how to create the env variable format
- Add your newly formatted variables into the .env like so e.g
CONFIG__DEFAULT__SYSTEM__SMTP__HOST="8.8.8.8"
- Flush the config cache
Compability
Magento 2 Open Source 2.3.x Magento 2 Open Source 2.4.x Magento 2 Commerce 2.3.x Magento 2 Commerce 2.4.x
License
All versions of magento2-dotenv with dependencies
magento/magento-composer-installer Version *
magento/module-config Version >=100.1.2
vlucas/phpdotenv Version ^2