|
@@ -11,24 +11,25 @@
|
|
|
|
|
|
namespace Symfony\Bundle\AsseticBundle\CacheWarmer;
|
|
namespace Symfony\Bundle\AsseticBundle\CacheWarmer;
|
|
|
|
|
|
-use Assetic\AssetManager;
|
|
|
|
use Assetic\AssetWriter;
|
|
use Assetic\AssetWriter;
|
|
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmer;
|
|
use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmer;
|
|
|
|
+use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
|
|
|
class AssetWriterCacheWarmer extends CacheWarmer
|
|
class AssetWriterCacheWarmer extends CacheWarmer
|
|
{
|
|
{
|
|
- protected $am;
|
|
|
|
- protected $writer;
|
|
|
|
|
|
+ private $container;
|
|
|
|
+ private $writer;
|
|
|
|
|
|
- public function __construct(AssetManager $am, AssetWriter $writer)
|
|
|
|
|
|
+ public function __construct(ContainerInterface $container, AssetWriter $writer)
|
|
{
|
|
{
|
|
- $this->am = $am;
|
|
|
|
|
|
+ $this->container = $container;
|
|
$this->writer = $writer;
|
|
$this->writer = $writer;
|
|
}
|
|
}
|
|
|
|
|
|
public function warmUp($cacheDir)
|
|
public function warmUp($cacheDir)
|
|
{
|
|
{
|
|
- $this->writer->writeManagerAssets($this->am);
|
|
|
|
|
|
+ $am = $this->container->get('assetic.asset_manager');
|
|
|
|
+ $this->writer->writeManagerAssets($am);
|
|
}
|
|
}
|
|
|
|
|
|
public function isOptional()
|
|
public function isOptional()
|