-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBundle] Fixed caching of templates in default path on cache warmup #27764
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
Conversation
Any update about this? @stof do you still think this solution is wrong? what is your suggestion? thanks. |
@stof How can we move forward on this? |
Can we move forward by providing some facts? About the issue, this is the bug reproducer (see As for the fix: adds the missing default Twig path in
It is the template name according to the test case. There is no I hope this helps to unlock the status of this PR. |
@yceruto but if you warmup the cache using |
an alternative might be to exclude |
0a4c079
to
2518755
Compare
2518755
to
450632a
Compare
b00c63d
to
245c860
Compare
@stof thanks for clarifying, you're right about Sorry for the firing of reviews on rebasing. |
@stof Can you review one last time before I merge? Thank you. |
Thank you @yceruto. |
… cache warmup (yceruto) This PR was merged into the 3.4 branch. Discussion ---------- [TwigBundle] Fixed caching of templates in default path on cache warmup | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - **Reproducer** ```bash $ git clone https://github.com/symfony/demo && cd demo $ bin/console cache:clear $ find var/cache/dev/twig -printf "%y\n" | awk '/f/{f++}/d/{d++}END{printf "%d directories, %d files\n", d, f}' ... ``` **Before:** ```bash ... 131 directories, 167 files ``` Twig `paths` config: https://github.com/symfony/symfony/blob/44ce4dd62536037f9cea4db0146541b4ab867d34/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php#L104 `%kernel.root_dir%/Resources/views`: https://github.com/symfony/symfony/blob/2b01d594818cf872bc481b3a1fe0210da29fab69/src/Symfony/Bundle/TwigBundle/TemplateIterator.php#L50 **After:** ```bash ... 141 directories, 193 files ``` Adding `%twig.default_path%`. Commits ------- 245c860 Fixed caching of templates in default path on cache warmup
…BundleName>/views on cache warmup (yceruto) This PR was merged into the 2.8 branch. Discussion ---------- [TwigBundle] Fixed caching of templates in src/Resources/<BundleName>/views on cache warmup | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Same as #27764, but in this case the convention is wrong. Corrected according to: https://github.com/symfony/symfony/blob/992a174470fd557e1cddccd3a35447209602aea3/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php#L165 Commits ------- 83a75f4 Caching missed templates on cache warmup
Reproducer
Before:
Twig
paths
config:symfony/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
Line 104 in 44ce4dd
%kernel.root_dir%/Resources/views
:symfony/src/Symfony/Bundle/TwigBundle/TemplateIterator.php
Line 50 in 2b01d59
After:
Adding
%twig.default_path%
.