-
-
Notifications
You must be signed in to change notification settings - Fork 451
Add support for .env file
#5130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
# Conflicts: # composer.json # composer.lock
# Conflicts: # composer.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for .env files to OpenMage using the vlucas/phpdotenv library, enabling developers to configure environment variables through a .env file rather than relying solely on system environment variables.
Key changes:
- Adds
vlucas/phpdotenvv5.6 dependency along with its dependencies (graham-campbell/result-typeandphpoption/phpoption) - Initializes dotenv in
app/Mage.phpto load.envfile from the application root - Changes
EnvironmentConfigLoaderto read from$_ENVinstead ofgetenv()to access variables loaded by phpdotenv - Adds
.envto.gitignoreto prevent committing sensitive configuration
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| composer.json | Adds vlucas/phpdotenv ^5.6 dependency |
| composer.lock | Locks new dependencies: phpdotenv v5.6.2, phpoption 1.9.4, and graham-campbell/result-type v1.1.3 |
| app/Mage.php | Initializes dotenv loader with integer validation for MAGE_IS_DEVELOPER_MODE and OPENMAGE_CONFIG_OVERRIDE_ALLOWED |
| app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php | Changes environment variable source from getenv() to $_ENV to read phpdotenv-loaded variables |
| .gitignore | Adds .env file to prevent committing sensitive configuration |
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
|



Description (*)
Adding missing piece to ENV config loader with adding support for
.envfiles.