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] remove cache warmers when Twig cache is disabled#28029

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:2.8fromxabbuh:issue-28009
Sep 4, 2018

Conversation

@xabbuh
Copy link
Member

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#28009
LicenseMIT
Doc PR


if (false ===$config['cache']) {
$container->removeDefinition('twig.cache_warmer');
$container->removeDefinition('twig.template_cache_warmer');
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Does someone remember why we have two cache warmers? Both classes aim to solve the same problem. Is it still necessary to keep both?

Copy link
Member

Choose a reason for hiding this comment

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

I looked at this a LONG time ago for#24608, but I can't remember what my conclusion was. Iirc, they DO indeed do the same thing, but maybe one has one slightly additional feature. Not too helpful, I know :)

xabbuh and yceruto reacted with laugh emoji
Copy link
Member

Choose a reason for hiding this comment

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

IIRCTemplateCacheCacheWarmer is the dedicated warmer fortemplating layer (if enabled), and it's necessary while this layer exists. In the other hand,TemplateCacheWarmer is the new version withouttemplating layer/dependecy.

@yceruto
Copy link
Member

This part should be updated as well:

$paths =$container->getDefinition('twig.cache_warmer')->getArgument(2);
$paths[$coreThemePath] =null;
$container->getDefinition('twig.cache_warmer')->replaceArgument(2,$paths);
$container->getDefinition('twig.template_iterator')->replaceArgument(2,$paths);

$container->getDefinition('twig.cache_warmer')->replaceArgument(2,$paths);
}

$container->getDefinition('twig.template_iterator')->replaceArgument(2,$paths);
Copy link
Member

Choose a reason for hiding this comment

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

variable$paths is undefined iftwig.cache_warmer doesn't exist, it must be included in the newif condition.

xabbuh reacted with thumbs up emoji
$paths =$container->getDefinition('twig.cache_warmer')->getArgument(2);
$paths[$coreThemePath] =null;
$container->getDefinition('twig.cache_warmer')->replaceArgument(2,$paths);
$container->getDefinition('twig.template_iterator')->replaceArgument(2,$paths);
Copy link
Member

Choose a reason for hiding this comment

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

either this service should be also removed when cache is disabled, or its configuration here should not be disabled when disabling the cache warming.

@fabpot
Copy link
Member

@xabbuh Can you finish this PR?

@xabbuh
Copy link
MemberAuthor

comments should be addressed now

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commitef1f7ff intosymfony:2.8Sep 4, 2018
fabpot added a commit that referenced this pull requestSep 4, 2018
…led (xabbuh)This PR was merged into the 2.8 branch.Discussion----------[TwigBundle] remove cache warmers when Twig cache is disabled| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#28009| License       | MIT| Doc PR        |Commits-------ef1f7ff remove cache warmers when Twig cache is disabled
@xabbuhxabbuh deleted the issue-28009 branchSeptember 4, 2018 09:11
This was referencedSep 30, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@weaverryanweaverryanweaverryan left review comments

@stofstofstof left review comments

@ycerutoycerutoyceruto left review comments

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

6 participants

@xabbuh@yceruto@fabpot@weaverryan@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp