You are here

public static function LibrariesCdn::search in Libraries CDN API 8

Same name and namespace in other branches
  1. 7 src/LibrariesCDN.php \Drupal\libraries_cdn\LibrariesCDN::search()

Return CDN Plugin id's of the CDN who provides a library.

Parameters

string $library: The library to search.

Return value

array $providers The array of providers who provides the searched library.

File

src/LibrariesCdn.php, line 78
Contains LibrariesCdn.

Class

LibrariesCdn
Class LibrariesCdn.

Namespace

Drupal\libraries_cdn

Code

public static function search($library) {
  $providers = array();
  foreach (self::getAvailableCdn() as $cdn) {
    self::setPlugin($cdn);
    $search = self::$plugin
      ->search($library);
    if (!empty($search)) {
      $providers[$cdn] = $search;
    }
  }
  return $providers;
}