Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TwigBundle] Usekernel.build_dir to store the templates known at build time#54384

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:7.3fromOkhoshi:twig-cache-build-dir
May 10, 2025

Conversation

Okhoshi
Copy link
Contributor

@OkhoshiOkhoshi commentedMar 23, 2024
edited
Loading

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issuesnone
LicenseMIT

Follow up to#50391, set up the TwigTemplateCacheWarmer to use thekernel.build_dir instead ofkernel.cache_dir. A new argument is added to its constructor to specify the directory to use for the cache.

valtzu reacted with thumbs up emoji
Copy link
Member

@GromNaNGromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Very good idea.

@OkhoshiOkhoshiforce-pushed thetwig-cache-build-dir branch 2 times, most recently from0dbdd9b to40e485cCompareMarch 27, 2024 10:41
@stof
Copy link
Member

shouldn't this dual cache setup be disabled when autoReload is enabled ? Otherwise, any template cached in the readonly cache won't be reloaded (as the cache never writes the new content) which will break the DX

GromNaN reacted with thumbs up emoji

@Okhoshi
Copy link
ContributorAuthor

shouldn't this dual cache setup be disabled when autoReload is enabled ? Otherwise, any template cached in the readonly cache won't be reloaded (as the cache never writes the new content) which will break the DX

I don't think it needs to. Looking at theEnvironment::loadTemplate method, it skips thecache::load call if autoReload is enabled, and callscache::write directly. As the ChainCache propagates the write to all caches, from that moment, only the Runtime cache will be used, with the updated copy of the template.
Or did I miss something ?

Copy link
Member

@GromNaNGromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I tested it on a project and got some functional feedback.

@GromNaN
Copy link
Member

Tests are failing.

Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "kernel.build_dir". Did you mean this: "kernel.cache_dir"?

…uild timeSigned-off-by: Quentin Devos <4972091+Okhoshi@users.noreply.github.com>
@Okhoshi
Copy link
ContributorAuthor

Tests are failing.

Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException: You have requested a non-existent parameter "kernel.build_dir". Did you mean this: "kernel.cache_dir"?

Fixed, I didn't realise the tests were using a smaller kernel.

GromNaN reacted with thumbs up emoji

@Okhoshi
Copy link
ContributorAuthor

@GromNaN@fabpot@nicolas-grekas@OskarStark Could we still get this merged in 7.3 ?

@fabpot
Copy link
Member

Thank you@Okhoshi.

cs278 reacted with hooray emoji

@fabpotfabpot merged commit532e408 intosymfony:7.3May 10, 2025
7 of 11 checks passed
@OkhoshiOkhoshi deleted the twig-cache-build-dir branchMay 10, 2025 08:41
@fabpotfabpot mentioned this pull requestMay 10, 2025
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMay 12, 2025
…ache config (Okhoshi)This PR was merged into the 7.3 branch.Discussion----------[Twig] [TwigBundle] Describe the new behaviour of twig.cache configUpdate the description of the `twig.cache` config to follow the changes implemented insymfony/symfony#54384.Fixes#20948cc `@alexandre`-dauboisCommits-------8c5f22b [TwigBundle] Describe the new behaviour of twig.cache config
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dkarlovidkarlovidkarlovi left review comments

@GromNaNGromNaNGromNaN approved these changes

@fabpotfabpotfabpot approved these changes

@ycerutoycerutoAwaiting requested review from ycerutoyceruto is a code owner

@derrabusderrabusAwaiting requested review from derrabus

@stofstofAwaiting requested review from stof

@nicolas-grekasnicolas-grekasAwaiting requested review from nicolas-grekas

@OskarStarkOskarStarkAwaiting requested review from OskarStark

Assignees
No one assigned
Labels
Feature❄️ Feature FreezeImportant Pull Requests to finish before the next Symfony "feature freeze"Status: ReviewedTwigBundle
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

11 participants
@Okhoshi@stof@fabpot@GromNaN@dkarlovi@nicolas-grekas@OskarStark@derrabus@yceruto@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp