diff --git a/sources/wordpress/sf2/sf2plugin.php b/sources/wordpress/sf2/sf2plugin.php index e7383a3..cd6286f 100755 --- a/sources/wordpress/sf2/sf2plugin.php +++ b/sources/wordpress/sf2/sf2plugin.php @@ -95,7 +95,16 @@ private function loadSf2() } } else { $this->kernel = $kernel; - $this->container = $kernel->getContainer(); + + if ($this->kernel instanceof AppCache) { + $this->kernel = $this->kernel->getKernel(); + } + + if (!is_subclass_of($this->kernel, 'Symfony\Component\HttpKernel\KernelInterface')) { + throw new RuntimeException("Le kernel doit implémenter Symfony\Component\HttpKernel\KernelInterface"); + } + + $this->container = $this->kernel->getContainer(); } $wp_loader = $this->container->get('wordpress.loader'); $wp_loader->load();