justbetter/dotenv

There is no license information available for the latest version (1.1.0) of this package.

Module to overwrite and set environment variables

Installs: 6 460

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 6

Forks: 0

Open Issues: 0

Type:magento2-module

1.1.0 2022-05-02 13:52 UTC

This package is auto-updated.

Last update: 2024-04-09 09:16:41 UTC


README

Adds support for .env configuration files to Magento 2. Variables in the .env file are used to fill in app/etc/env.php variables. This file can be added to source control when using this package. I think having more than one environment file is weird.

Credits

Credits to this package which inspired me to make this package.

Installation

  • composer require justbetter/dotenv
  • Copy the .env.example example file to app/etc/.env and fill in your environment variables.
  • Replace the env.php with this one and commit it to source control.
  • bin/magento setup:upgrade

Extending the environments

You can override specific environments with the APP_ENV variable in the dot env filename. example. Copy the file to app/etc/ and modify for any specified environment.

Disabled the writer to env.php

Because of the Writer class of magento 2 the env.php get rewrited every time. I disabled this functionality because the env.php file is not static. The cache types are not reset every time when you run bin/magento setup:upgrade.

Compatibility

The module is tested on Magento version 2.3.x

Ideas, bugs or suggestions?

Please create a issue or a pull request.

About us

We’re a innovative development agency from The Netherlands building awesome websites, webshops and web applications with Laravel and Magento. Check out our website justbetter.nl and our open source projects.

License

MIT

JustBetter logo