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
Next Next commit
[TwigBundle] removed YAML Twig extension when the YAML component is n…
…ot available
  • Loading branch information
fabpot committed Sep 30, 2016
commit d0792e454e838b90af73167e1e528e3de04bb4b7
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@ public function process(ContainerBuilder $container)
if ($container->has('assets.packages')) {
$container->getDefinition('twig.extension.assets')->addTag('twig.extension');
}

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');
}
}
}
4 changes: 1 addition & 3 deletions src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@
<argument type="service" id="router" />
</service>

<service id="twig.extension.yaml" class="Symfony\Bridge\Twig\Extension\YamlExtension" public="false">
<tag name="twig.extension" />
</service>
<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" />
Expand Down
0