Skip to content

Instantly share code, notes, and snippets.

@fritzmg
Created February 18, 2026 08:52
Show Gist options
  • Select an option

  • Save fritzmg/93ffd7a802b875c839797a9212b64df5 to your computer and use it in GitHub Desktop.

Select an option

Save fritzmg/93ffd7a802b875c839797a9212b64df5 to your computer and use it in GitHub Desktop.
Disable AutoRefreshTemplateHierarchyListener
<?php
// src/ContaoManager/Plugin.php
declare(strict_types=1);
namespace App\ContaoManager;
use Contao\ManagerPlugin\Config\ConfigPluginInterface;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class Plugin implements ConfigPluginInterface
{
public function registerContainerConfiguration(LoaderInterface $loader, array $managerConfig): void
{
$loader->load(
static function (ContainerBuilder $container): void {
$container->addCompilerPass(new class() implements CompilerPassInterface {
public function process(ContainerBuilder $container): void
{
$container->removeDefinition('contao.twig.loader.auto_refresh_template_hierarchy_listener');
}
});
},
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment