You are here

public function CDNJS::__construct in Libraries CDN API 7

Same name and namespace in other branches
  1. 8 src/Plugin/LibrariesCdn/CdnJs.php \Drupal\libraries_cdn\Plugin\LibrariesCdn\CdnJs::__construct()

Overrides CDNBase::__construct

File

src/Plugin/LibrariesCDN/CDNJS.php, line 29
Plugin: CDNJS.

Class

CDNJS
Class CDNJS.

Namespace

Drupal\libraries_cdn\Plugin\LibrariesCDN

Code

public function __construct(array $configuration, $plugin_id, array $plugin_definition, Drupal7 $drupal7) {
  if (empty($configuration['urls'])) {
    $configuration['urls'] = array();
  }
  $configuration['urls'] += array(
    'isAvailable' => 'http://api.cdnjs.com/libraries?search=%s',
    'getInformation' => 'http://api.cdnjs.com/libraries/%s',
    'getVersions' => 'http://api.cdnjs.com/libraries/%s',
    'getFiles' => 'http://api.cdnjs.com/libraries/%s',
    'search' => 'http://api.cdnjs.com/libraries?search=%s&fields=version,assets,description',
    'convertFiles' => '//cdnjs.cloudflare.com/ajax/libs/%s/%s/',
  );
  parent::__construct($configuration, $plugin_id, $plugin_definition, $drupal7);
}