LibraryDiscoveryInterface

Discovers information for asset (CSS/JavaScript) libraries. Library information is statically cached. Libraries are keyed by extension for several reasons: Libraries are not unique. Multiple extensions might ship with the same library in a different version or variant. This registry cannot (and does not attempt to) prevent library conflicts. Extensions implementing and thereby depending on a library that is registered by another extension can only rely on that extension's library. Two (or more)

LibraryDiscoveryCollector::__construct

public LibraryDiscoveryCollector::__construct(CacheBackendInterface $cache, LockBackendInterface $lock, LibraryDiscoveryParser $discovery_parser, ThemeManagerInterface $theme_manager) Constructs a CacheCollector object. Parameters \Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend. \Drupal\Core\Lock\LockBackendInterface $lock: The lock backend. \Drupal\Core\Asset\LibraryDiscoveryParser $discovery_parser: The library discovery parser. \Drupal\Core\Theme\ThemeManagerInterface $th

LibraryDiscoveryCollector::resolveCacheMiss

protected LibraryDiscoveryCollector::resolveCacheMiss($key) Resolves a cache miss. When an offset is not found in the object, this is treated as a cache miss. This method allows classes using this implementation to look up the actual value and allow it to be cached. Parameters string $key: The offset that was requested. Return value mixed The value of the offset, or NULL if no value was found. Overrides CacheCollector::resolveCacheMiss File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector

LibraryDiscoveryCollector::reset

public LibraryDiscoveryCollector::reset() Resets the local cache. Does not clear the persistent cache. Overrides CacheCollector::reset File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 159 Class LibraryDiscoveryCollector A CacheCollector implementation for building library extension info. Namespace Drupal\Core\Asset Code public function reset() { parent::reset(); $this->cid = NULL; }

LibraryDiscoveryCollector::getLibraryDefinitions

protected LibraryDiscoveryCollector::getLibraryDefinitions($extension) Returns the library definitions for a given extension. This also implements libraries-overrides for entire libraries that have been specified by the LibraryDiscoveryParser. Parameters string $extension: The name of the extension for which library definitions will be returned. Return value array The library definitions for $extension with overrides applied. Throws \Drupal\Core\Asset\Exception\InvalidLibrariesOverrideSpecif

LibraryDiscoveryCollector::getCid

protected LibraryDiscoveryCollector::getCid() Gets the cache ID. Return value string Overrides CacheCollector::getCid File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 54 Class LibraryDiscoveryCollector A CacheCollector implementation for building library extension info. Namespace Drupal\Core\Asset Code protected function getCid() { if (!isset($this->cid)) { $this->cid = 'library_info:' . $this->themeManager->getActiveTheme()->getName(); } r

LibraryDiscoveryCollector::applyLibrariesExtend

protected LibraryDiscoveryCollector::applyLibrariesExtend($extension, $library_name, $library_definition) Applies the libraries-extend specified by the active theme. This extends the library definitions with the those specified by the libraries-extend specifications for the active theme. Parameters string $extension: The name of the extension for which library definitions will be extended. string $library_name: The name of the library whose definitions is to be extended. $library_definition: T

LibraryDiscoveryCollector::$themeManager

The theme manager. Type: \Drupal\Core\Theme\ThemeManagerInterface File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 30 Class LibraryDiscoveryCollector A CacheCollector implementation for building library extension info. Namespace Drupal\Core\Asset Code protected $themeManager;

LibraryDiscoveryCollector::$discoveryParser

The library discovery parser. Type: \Drupal\Core\Asset\LibraryDiscoveryParser File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 23 Class LibraryDiscoveryCollector A CacheCollector implementation for building library extension info. Namespace Drupal\Core\Asset Code protected $discoveryParser;

LibraryDiscoveryCollector

A CacheCollector implementation for building library extension info. Hierarchy class \Drupal\Core\Cache\CacheCollector implements CacheCollectorInterface, DestructableInterfaceclass \Drupal\Core\Asset\LibraryDiscoveryCollector File core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php, line 16 Namespace Drupal\Core\Asset Members Name Modifiers Type Description CacheCollector::$cache protected property The cache backend that should be used. CacheCollector::$cacheCre