Repository navigation
Only write the legacy routing alias cache when caching is enabled - #554
Closed
buyolitsez wants to merge 2 commits into
Closed
buyolitsez wants to merge 2 commits into
buyolitsez wants to merge 2 commits into
Conversation
Contributor
|
Setting IniCache to 1 fixes the recreation of the file as long as the file exists. The generated file alias.cache.ini has been stale for years now, just commiting the file and updating the rox_default.ini should do the trick. No need for code changes or unit tests that break depending on where they are run. |
Contributor
|
Fixed with #610. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #502
Problem
Every legacy page load logs a
file_put_contents(build/alias.cache.ini): Failed to open streamwarning.rox_docker.inisetsIniCache = "0". That makes$force_refreshalways true inRequestRouter::loadRoutingAliasTable(), so the cache file is never read.iniWrite()on every request.build/belongs to root in the image and PHP-FPM runs aswww-data, so the write fails.Changes
tools/routing/requestrouter.class.php: only write the alias cache when caching is actually on, i.e. wrapiniWrite()inif (!$force_refresh). This is option D from the issue.IniCache = 0(or on localhost), nothing is written and routing behaves as before.IniCache = 1, the cache is still written and read as before.Testing
New
tests/Tools/RequestRouterTest.php, a plain unit test with no kernel or DB. It covers caching disabled, localhost and caching enabled. Ondevelopthe disabled and localhost cases fail.Notes
The issue suggests a PR on
feature/docker-master. This patch applies cleanly there too, so I can open a second PR against it if you prefer.