8000 added Twig runtimes for "critical" Twig extensions by fabpot · Pull Request #20094 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

added Twig runtimes for "critical" Twig extensions #20094

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

Merged
merged 5 commits into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[TwigBundle] removed Stopwatch Twig extension when the Stopwatch comp…
…onent is not available
  • Loading branch information
fabpot committed Sep 30, 2016
commit 3d4ad0b084347551a979c8286bc06abd80928611
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ public function process(ContainerBuilder $container)
if (class_exists('Symfony\Component\Yaml\Parser')) {
Copy link
Member

Choose a reason for hiding this comment

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

As the definition of the container now depends on the existence of a class, we should define a ClassExistenceResource and add such a resource to the container for such patterns (outside the if), so that the debug container is reloaded if you install the class

Copy link
Member Author

Choose a reason for hiding this comment

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

That's for another PR as this is not the only place where we are doing this in a compiler pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

see #20121

$container->getDefinition('twig.extension.yaml')->addTag('twig.extension');
}

if (class_exists('Symfony\Component\Stopwatch\Stopwatch')) {
$container->getDefinition('twig.extension.debug.stopwatch')->addTag('twig.extension');
}
}
}
1 change: 0 additions & 1 deletion src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
<service id="twig.extension.yaml" class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false" />

<service id="twig.extension.debug.stopwatch" class="Symfony\Bridge\Twig\Extension\StopwatchExtension" public="false">
<tag name="twig.extension" />
<argument type="service" id="debug.stopwatch" on-invalid="ignore" />
<argument>%kernel.debug%</argument>
</service>
Expand Down
0