Created
February 17, 2012 10:24
-
-
Save armetiz/1852492 to your computer and use it in GitHub Desktop.
Classes cache warmup.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This file is part of the Symfony package. | |
* | |
* (c) Fabien Potencier <fabien@symfony.com> | |
* | |
* For the full copyright and license information, please view the LICENSE | |
* file that was distributed with this source code. | |
*/ | |
namespace Acme\BundleTest\CacheWarmer; | |
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; | |
use Symfony\Component\HttpKernel\Kernel; | |
/** | |
* Generates the router matcher and generator classes. | |
* | |
* @author Fabien Potencier <fabien@symfony.com> | |
*/ | |
class ClassesWarmer implements CacheWarmerInterface | |
{ | |
protected $kernel; | |
/** | |
* Constructor. | |
* | |
* @param Router $router A Router instance | |
*/ | |
public function __construct(Kernel $kernel) | |
{ | |
$this->kernel = $kernel; | |
} | |
/** | |
* Warms up the cache. | |
* | |
* @param string $cacheDir The cache directory | |
*/ | |
public function warmUp($cacheDir) | |
{ | |
$this->kernel->loadClassCache(); | |
} | |
/** | |
* Checks whether this warmer is optional or not. | |
* | |
* @return Boolean always true | |
*/ | |
public function isOptional() | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment