AssetManagerCacheWarmer.php 930B

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