cache_debug.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  11. use Symfony\Bundle\FrameworkBundle\CacheWarmer\CachePoolClearerCacheWarmer;
  12. use Symfony\Component\Cache\DataCollector\CacheDataCollector;
  13. return static function (ContainerConfigurator $container) {
  14. $container->services()
  15. // DataCollector (public to prevent inlining, made private in CacheCollectorPass)
  16. ->set('data_collector.cache', CacheDataCollector::class)
  17. ->public()
  18. ->tag('data_collector', [
  19. 'template' => '@WebProfiler/Collector/cache.html.twig',
  20. 'id' => 'cache',
  21. 'priority' => 275,
  22. ])
  23. // CacheWarmer used in dev to clear cache pool
  24. ->set('cache_pool_clearer.cache_warmer', CachePoolClearerCacheWarmer::class)
  25. ->args([
  26. service('cache.system_clearer'),
  27. [
  28. 'cache.validator',
  29. 'cache.serializer',
  30. ],
  31. ])
  32. ->tag('kernel.cache_warmer', ['priority' => 64])
  33. ;
  34. };