Skip to content

Commit

Permalink
gestion du kernel si AppCache est activé (#41)
Browse files Browse the repository at this point in the history
* gestion du kernel si AppCache est activé

* verification si le kernel implémente bien kernelinterface

* refacto ->kernel

* code redondant
  • Loading branch information
bjulien authored and juliens committed Oct 20, 2016
1 parent ea94bea commit a479cc1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sources/wordpress/sf2/sf2plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a479cc1

Please sign in to comment.