Skip to content

Commit 2dea1da

Browse files
committed
remove service when base class is missing
1 parent ec781c9 commit 2dea1da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler;
1313

14+
use Symfony\Bridge\Twig\TwigEngine;
1415
use Symfony\Component\DependencyInjection\Alias;
1516
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -119,6 +120,10 @@ public function process(ContainerBuilder $container)
119120
$loader = $container->getDefinition('twig.loader.filesystem');
120121
$loader->setMethodCalls(array_merge($twigLoader->getMethodCalls(), $loader->getMethodCalls()));
121122

123+
if (!class_exists(TwigEngine::class)) {
124+
$container->removeDefinition('templating.engine.twig');
125+
}
126+
122127
$twigLoader->clearTag('twig.loader');
123128
} else {
124129
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy