-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Feature/env variables override config #3842
Feature/env variables override config #3842
Conversation
Unit tests fail on php8 https://github.com/OpenMage/magento-lts/actions/runs/7957571133/job/21720971313?pr=3842 |
I dont have these fails locally on 8.1.27. Not sure whats broken. |
Anyone know what the problem is on the tests on PHP8? |
Co-authored-by: Fabrizio Balliano <[email protected]>
Co-authored-by: Ng Kiat Siong <[email protected]>
…ys in the CMS section (OpenMage#3851)
dev/tests/unit/Mage/Core/Helper/EnvironmentConfigLoaderTest.php
Outdated
Show resolved
Hide resolved
…nMage#3850) Co-authored-by: Sven Reichel <[email protected]>
…penMage#2150) Co-authored-by: Fabrizio Balliano <[email protected]> Co-authored-by: Ng Kiat Siong <[email protected]>
…b.com/pquerner/magento-lts into feature/ENV-variables-override-config
The constructor of Mage_Core_Model_Config inherits from Varien_Object and its first argument is written to $this->data. So when the "constructor" of Mage_Core_Model_Config kicks in, it wanted to write an array to a already populated $this->_data variable, which yields errors since PHP 7.1.
Unittests have been fixed. |
It seems something went wrong with the rebase because the PR has 26 modified files :-\ |
Oh darn, you're right. Let me see if I can fix that. |
No idea, and I don't have a backup branch sadly. Maybe close and open again from the branch? The remote branch on my fork doesnt have that many changed files. Or do you see another way @fballiano ? |
Re-opened the PR here #3863 |
Description (*)
This PR attempts to implement Magento 2's feature of overwriting config values by the $_ENV variable.
The Magento 2 feature is documented here [1].
Related Pull Requests
Fixed Issues (if relevant)
getConfig()
reference env variables that could override values specified in XML or the database? #643Manual testing scenarios (*)
All steps assume you are using ddev as development enviroment.
web_enviroment
setting:web_environment: ["OPENMAGE_CONFIG__DEFAULT__GENERAL__STORE_INFORMATION__NAME=default", "OPENMAGE_CONFIG__WEBSITES__BASE__GENERAL__STORE_INFORMATION__NAME=website", "OPENMAGE_CONFIG__STORES__GERMAN__GENERAL__STORE_INFORMATION__NAME=store_german"]
web_environment
(Else you can also set the variables in your server configuration, either in nginx or apache2 config)
Automated testing scenarios (*)
I've given a PhpUnit test file to execute. The tests check if all scopes are correctly overwritten after calling the new EnvironmentLoader helper.
Questions or comments
This feature was requested in #643 and @Flyingmana asked me to take a look at it.
Its use-case must be documented. @Flyingmana might be able to help out with that.
ToDo / To be discussed further
I think the feature must be better implemented and documented (perhaps) than the original M2 feature-set.
For example its a little unclear (I didnt take a peek at M2 implementation) what should happen if you wish to "unset"/"delete" (?) a config value.
For now I want to gather some needed feedback.
Questions for example I have:
[1] https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/paths/override-config-settings.html
Contribution checklist (*)
(did none here, if someone can fix it pre-merge that would be great. Last time I executed that
yarn all-contributors
I didnt get added properly)