/** * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, array $plugin_definition) { if (empty($configuration['urls'])) { $configuration['urls'] = array(); } $configuration['urls'] += array('isAvailable' => 'http://api.jsdelivr.com/v1/jsdelivr/libraries/%s', 'getInformation' => 'http://api.jsdelivr.com/v1/jsdelivr/libraries?name=%s&fields=name,mainfile,lastversion,description,homepage,github,author', 'getVersions' => 'http://api.jsdelivr.com/v1/jsdelivr/libraries?name=%s&fields=versions', 'getFiles' => 'http://api.jsdelivr.com/v1/jsdelivr/libraries?name=%s&fields=assets', 'search' => 'http://api.jsdelivr.com/v1/jsdelivr/libraries?name=*%s*', 'convertFiles' => '//cdn.jsdelivr.net/%s/%s/'); parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, array $plugin_definition) { 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?search=%s&fields=assets', 'getFiles' => 'http://api.cdnjs.com/libraries/%s', 'search' => 'http://api.cdnjs.com/libraries?search=%s', 'convertFiles' => '//cdnjs.cloudflare.com/ajax/libs/%s/%s/'); parent::__construct($configuration, $plugin_id, $plugin_definition); }