Mercurial > hg > isophonics-drupal-site
annotate core/lib/Drupal/Core/Asset/LibraryDiscoveryInterface.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace Drupal\Core\Asset; |
Chris@0 | 4 |
Chris@0 | 5 /** |
Chris@0 | 6 * Discovers information for asset (CSS/JavaScript) libraries. |
Chris@0 | 7 * |
Chris@0 | 8 * Library information is statically cached. Libraries are keyed by extension |
Chris@0 | 9 * for several reasons: |
Chris@0 | 10 * - Libraries are not unique. Multiple extensions might ship with the same |
Chris@0 | 11 * library in a different version or variant. This registry cannot (and does |
Chris@0 | 12 * not attempt to) prevent library conflicts. |
Chris@0 | 13 * - Extensions implementing and thereby depending on a library that is |
Chris@0 | 14 * registered by another extension can only rely on that extension's library. |
Chris@0 | 15 * - Two (or more) extensions can still register the same library and use it |
Chris@0 | 16 * without conflicts in case the libraries are loaded on certain pages only. |
Chris@0 | 17 */ |
Chris@0 | 18 interface LibraryDiscoveryInterface { |
Chris@0 | 19 |
Chris@0 | 20 /** |
Chris@0 | 21 * Gets all libraries defined by an extension. |
Chris@0 | 22 * |
Chris@0 | 23 * @param string $extension |
Chris@0 | 24 * The name of the extension that registered a library. |
Chris@0 | 25 * |
Chris@0 | 26 * @return array |
Chris@0 | 27 * An associative array of libraries registered by $extension is returned |
Chris@0 | 28 * (which may be empty). |
Chris@0 | 29 * |
Chris@0 | 30 * @see self::getLibraryByName() |
Chris@0 | 31 */ |
Chris@0 | 32 public function getLibrariesByExtension($extension); |
Chris@0 | 33 |
Chris@0 | 34 /** |
Chris@0 | 35 * Gets a single library defined by an extension by name. |
Chris@0 | 36 * |
Chris@0 | 37 * @param string $extension |
Chris@0 | 38 * The name of the extension that registered a library. |
Chris@0 | 39 * @param string $name |
Chris@0 | 40 * The name of a registered library to retrieve. |
Chris@0 | 41 * |
Chris@0 | 42 * @return array|false |
Chris@0 | 43 * The definition of the requested library, if $name was passed and it |
Chris@0 | 44 * exists, otherwise FALSE. |
Chris@0 | 45 */ |
Chris@0 | 46 public function getLibraryByName($extension, $name); |
Chris@0 | 47 |
Chris@0 | 48 /** |
Chris@0 | 49 * Clears static and persistent library definition caches. |
Chris@0 | 50 */ |
Chris@0 | 51 public function clearCachedDefinitions(); |
Chris@0 | 52 |
Chris@0 | 53 } |