You are here

public static function LibrariesCDN::search in Libraries CDN API 7

Same name and namespace in other branches
  1. 8 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.

1 call to LibrariesCDN::search()
libraries_cdn_ui_library_autocomplete_callback in modules/libraries_cdn_ui/libraries_cdn_ui.admin.inc

File

src/LibrariesCDN.php, line 77
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;
}