Skip to content

Conversation

@s2b
Copy link
Contributor

@s2b s2b commented Nov 24, 2025

Due to refactorings in the cache layer of Fluid, which were necessary
to make cache warmup feasible, the cache identifiers have changed
with Fluid 5. This currently leads to parse errors when a template
name starts with a number because the associated cache file and most
importantly the generated PHP class name also starts with that number,
which isn't allowed in PHP.

This patch addresses that issue by prepending "template_" to cache
identifiers. Other special characters are already dealt with in
TemplateCompiler, so we only need to ensure that the identifier
starts with an alpha-character.

Resolves: #1266

Due to refactorings in the cache layer of Fluid, which were necessary
to make cache warmup feasible, the cache identifiers have changed
with Fluid 5. This currently leads to parse errors when a template
name starts with a number because the associated cache file and most
importantly the generated PHP class name also starts with that number,
which isn't allowed in PHP.

This patch addresses that issue by prepending "template_" to cache
identifiers. Other special characters are already dealt with in
`TemplateCompiler`, so we only need to ensure that the identifier
starts with an alpha-character.

Resolves: #1266
@s2b s2b merged commit 03ef568 into main Nov 24, 2025
10 checks passed
@s2b s2b deleted the bugfix/cacheClassName branch November 24, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid cache identifier starting with number

3 participants