Skip to content

Commit

Permalink
Alternate fix for schmittjoh#96; tested with symfony-standard v2.2.3 …
Browse files Browse the repository at this point in the history
…(and v2.3.1 with JMSDiExtraBundle and JMSSecurityExtraBundle dependencies restored)
  • Loading branch information
robocoder committed Jul 4, 2013
1 parent 609c331 commit 3daedc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions HttpKernel/ControllerInjectorsWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@

class ControllerInjectorsWarmer implements CacheWarmerInterface
{
static protected $warm;
private $kernel;
private $controllerResolver;
private $blackListedControllerFiles;

public function __construct(KernelInterface $kernel, ControllerResolver $resolver, array $blackListedControllerFiles)
{
static::$warm = false;
$this->kernel = $kernel;
$this->controllerResolver = $resolver;
$this->blackListedControllerFiles = $blackListedControllerFiles;
}

public function warmUp($cacheDir)
{
if (static::$warm === true) {
return;
}

static::$warm = true;

// This avoids class-being-declared twice errors when the cache:clear
// command is called. The controllers are not pre-generated in that case.
$suffix = defined('Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate::NEW_CACHE_FOLDER_SUFFIX')
Expand Down

0 comments on commit 3daedc9

Please sign in to comment.