Skip to content

Conversation

@sreichel
Copy link
Contributor

@sreichel sreichel commented Dec 4, 2025

Description (*)

Adding missing piece to ENV config loader with adding support for .env files.

Copilot AI review requested due to automatic review settings December 4, 2025 17:09
@github-actions github-actions bot added Component: Core Relates to Mage_Core Mage.php Relates to app/Mage.php composer Relates to composer.json git labels Dec 4, 2025
Copilot finished reviewing on behalf of sreichel December 4, 2025 17:14
Copy link
Contributor

Copilot AI left a 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/phpdotenv v5.6 dependency along with its dependencies (graham-campbell/result-type and phpoption/phpoption)
  • Initializes dotenv in app/Mage.php to load .env file from the application root
  • Changes EnvironmentConfigLoader to read from $_ENV instead of getenv() to access variables loaded by phpdotenv
  • Adds .env to .gitignore to 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

@sreichel sreichel requested a review from Copilot December 4, 2025 17:32
Copilot finished reviewing on behalf of sreichel December 4, 2025 17:39
Copy link
Contributor

Copilot AI left a 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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 4, 2025

@sreichel sreichel modified the milestones: 20.18.0, 20.17.0 Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Core Relates to Mage_Core composer Relates to composer.json documentation git Mage.php Relates to app/Mage.php new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants