class ListCacheBinsPass

Adds cache_bins parameter to the container.

Hierarchy

Expanded class hierarchy of ListCacheBinsPass

1 file declares its use of ListCacheBinsPass
CoreBundle.php in drupal/core/lib/Drupal/Core/CoreBundle.php
Definition of Drupal\Core\CoreBundle.

File

drupal/core/lib/Drupal/Core/Cache/ListCacheBinsPass.php, line 16
Contains \Drupal\Core\Cache\ListCacheBinsPass.

Namespace

Drupal\Core\Cache
View source
class ListCacheBinsPass implements CompilerPassInterface {

  /**
   * Implements CompilerPassInterface::process().
   *
   * Collects the cache bins into the cache_bins parameter.
   */
  public function process(ContainerBuilder $container) {
    $cache_bins = array();
    foreach ($container
      ->findTaggedServiceIds('cache.bin') as $id => $attributes) {
      $cache_bins[$id] = substr($id, strpos($id, '.') + 1);
    }
    $container
      ->setParameter('cache_bins', $cache_bins);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ListCacheBinsPass::process public function Implements CompilerPassInterface::process(). Overrides CompilerPassInterface::process