|
0
|
1 |
<?php |
|
|
2 |
|
|
|
3 |
/* |
|
|
4 |
* This file is part of the Symfony framework. |
|
|
5 |
* |
|
|
6 |
* (c) Fabien Potencier <fabien@symfony.com> |
|
|
7 |
* |
|
|
8 |
* This source file is subject to the MIT license that is bundled |
|
|
9 |
* with this source code in the file LICENSE. |
|
|
10 |
*/ |
|
|
11 |
|
|
|
12 |
namespace Symfony\Bundle\AsseticBundle\CacheWarmer; |
|
|
13 |
|
|
|
14 |
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; |
|
|
15 |
use Symfony\Component\DependencyInjection\ContainerInterface; |
|
|
16 |
|
|
|
17 |
/** |
|
|
18 |
* The AssetManagerCacheWarmer warms up the formula loader. |
|
|
19 |
* |
|
|
20 |
* @author Kris Wallsmith <kris@symfony.com> |
|
|
21 |
*/ |
|
|
22 |
class AssetManagerCacheWarmer implements CacheWarmerInterface |
|
|
23 |
{ |
|
|
24 |
private $container; |
|
|
25 |
|
|
|
26 |
public function __construct(ContainerInterface $container) |
|
|
27 |
{ |
|
|
28 |
$this->container = $container; |
|
|
29 |
} |
|
|
30 |
|
|
|
31 |
public function warmUp($cacheDir) |
|
|
32 |
{ |
|
|
33 |
$am = $this->container->get('assetic.asset_manager'); |
|
|
34 |
$am->load(); |
|
|
35 |
} |
|
|
36 |
|
|
|
37 |
public function isOptional() |
|
|
38 |
{ |
|
|
39 |
return true; |
|
|
40 |
} |
|
|
41 |
} |