mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°6934 - Symfony 6.4 - upgrade Symfony bundles to 6.4 (#580)
* Update Symfony lib to version ~6.4.0 * Update code missing return type * Add an iTop general configuration entry to store application secret (Symfony mandatory parameter) * Use dependency injection in ExceptionListener & UserProvider classes
This commit is contained in:
@@ -25,6 +25,9 @@ use Symfony\Component\Yaml\Yaml;
|
||||
*/
|
||||
class ExtensionPass implements CompilerPassInterface
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (!class_exists(Packages::class)) {
|
||||
@@ -43,6 +46,12 @@ class ExtensionPass implements CompilerPassInterface
|
||||
$container->removeDefinition('twig.extension.yaml');
|
||||
}
|
||||
|
||||
if (!$container->has('asset_mapper')) {
|
||||
// edge case where AssetMapper is installed, but not enabled
|
||||
$container->removeDefinition('twig.extension.importmap');
|
||||
$container->removeDefinition('twig.runtime.importmap');
|
||||
}
|
||||
|
||||
$viewDir = \dirname((new \ReflectionClass(\Symfony\Bridge\Twig\Extension\FormExtension::class))->getFileName(), 2).'/Resources/views';
|
||||
$templateIterator = $container->getDefinition('twig.template_iterator');
|
||||
$templatePaths = $templateIterator->getArgument(1);
|
||||
@@ -69,6 +78,10 @@ class ExtensionPass implements CompilerPassInterface
|
||||
$container->getDefinition('twig.extension.routing')->addTag('twig.extension');
|
||||
}
|
||||
|
||||
if ($container->has('html_sanitizer')) {
|
||||
$container->getDefinition('twig.extension.htmlsanitizer')->addTag('twig.extension');
|
||||
}
|
||||
|
||||
if ($container->has('fragment.handler')) {
|
||||
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
|
||||
$container->getDefinition('twig.runtime.httpkernel')->addTag('twig.runtime');
|
||||
|
||||
Reference in New Issue
Block a user