-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Separate cache_types from app/etc/config.php #32605
base: 2.5-develop
Are you sure you want to change the base?
Conversation
Hi @kassner. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Thanks for your contribution. |
I believe that move the cache part to a separate file has the same drawback as having it in env.php.
Not necessarily. env.php should definitely stay read-only, as being able to change the MySQL credentials in a running shop is a no-no. That could be overwritten in the cache.php by writing the db credentials sections to it, but that could be mitigated by guaranteeing that the env.php will be merged last.
For example: for disabling Layout Cache you can set env variable MAGENTO_CACHE_TYPES__LAYOUT=0 (config key cache_types/layout)
If you run magento in kubernetes, changing the environment variable for PHP-FPM means changing the deployment, which has the same effort as changing a read-only file, so in the end it means the caches can’t be toggled in runtime anymore.
|
BTW: I rather discuss the appropriate solution for this problem in the original ticket (#26292), as this PR is just one of the possible implementations.
|
Moved to #26292 (comment) |
@ihor-sviziev please open this discussion in #26292. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@ihor-sviziev: should we change the target branch to |
@hostep I think yes, but general question if we can accept it at all due to this is a backward incompatible change |
Hello @kassner, Thanks for the contribution! As this PR is targeted to the 2.5-develop branch, we are not processing the PRs with 2.5-develop for now. So I request you to please change the target to 2.4-develop so that we can move further with this PR. Till the time we are moving this PR on hold. Thanks |
We are currently processing PRs targeted to 2.4-develop only. So, removing this from the community picked backlog for now. |
Description
When trying to run Magento in a read-only filesystem, ideally both
config.php
andenv.php
should be read-only as well, but that breaks the ability of turning on/off any cache type in usingphp bin/magento cache:(disable|enable)
. This PR splits thecache_types
key away fromconfig.php
, so system administrators can still guarantee that theconfig.php
and all its values can't be changed during execution, but still allow the caches to be toggled by mountingapp/etc/cache.php
into a writable filesystem.Fixed Issues (if relevant)
Manual testing scenarios
app/etc/cache.php
in a writable filesystem (symbolic link works);php bin/magento cache:disable
Contribution checklist (*)