Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zepgram/magento-dotenv
Magento 2 Environment Variable Component - Implementing Symfony Dotenv
https://github.com/zepgram/magento-dotenv
environment-variables magento-dotenv magento2 symfony-dotenv
Last synced: 26 days ago
JSON representation
Magento 2 Environment Variable Component - Implementing Symfony Dotenv
- Host: GitHub
- URL: https://github.com/zepgram/magento-dotenv
- Owner: zepgram
- License: mit
- Created: 2020-02-27T18:22:27.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T12:24:23.000Z (10 months ago)
- Last Synced: 2024-11-02T00:32:24.335Z (about 1 month ago)
- Topics: environment-variables, magento-dotenv, magento2, symfony-dotenv
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-magento2 - Dot Env - Magento 2 Environment Variable Component - Implementing Symfony Dotenv. (Open Source Extensions / Development Utilities)
- awesome-magento2 - Dot Env - Magento 2 Environment Variable Component - Implementing Symfony Dotenv. (Open Source Extensions / Development Utilities)
README
# Magento Dotenv
Simple autoloader to integrate Symfony Dotenv component to Magento2.
The implementation can be found under path ``app/dotenv.php`` and can be configured safely for your needs.# Compatibility
| Magento Dotenv | v1.* | v2.* |
|----------------|------|-------------|
| Symfony Dotenv | ^5.0 | ^5.4 / ^6.0 |
| PHP version | ^7.0 | ^8.0 |# Installation
```
composer require zepgram/magento-dotenv
```# How to
You can use it similar way as a Symfony project:
1. If .env exists, it is loaded first. In case there's no .env file but a .env.dist, this one will be loaded instead.
1. If one of the previously mentioned files contains the APP_ENV variable, the variable is populated and used to load environment-specific files hereafter. If APP_ENV is not defined in either of the previously mentioned files, dev is assumed for APP_ENV and populated by default.
1. If there's a .env.local representing general local environment variables it's loaded now.
1. If there's a .env.$env.local file, this one is loaded. Otherwise, it falls back to .env.$env.You can freely edit ``app/dotenv.php``: this file will be not updated.
For more information you can follow the documentation:
https://symfony.com/doc/current/components/dotenv.html