public function CDNBase::query in Libraries CDN API 7
Request wrapper for querying a CDN.
Parameters
string $url: The URL.
Return value
array The json data from the request, decoded.
Overrides CDNBaseInterface::query
6 calls to CDNBase::query()
- CDNBase::getFiles in src/
Type/ CDNBase.php - Return all available file(s).
- CDNBase::getInformation in src/
Type/ CDNBase.php - Get library information.
- CDNBase::getVersions in src/
Type/ CDNBase.php - Return all available version(s).
- CDNBase::isAvailable in src/
Type/ CDNBase.php - Check if library is available.
- CDNBase::search in src/
Type/ CDNBase.php - Perform a search for a library.
File
- src/
Type/ CDNBase.php, line 117 - Class CDNBase.
Class
- CDNBase
- Class CDNBase.
Namespace
Drupal\libraries_cdn\TypeCode
public function query($url) {
list($scheme, $url) = explode('://', $url, 2);
$request = $this
->request(sprintf('%s://' . $url, $this
->getScheme($scheme), $this
->getLibrary()));
if ($request['code'] != 200) {
return array();
}
$data = json_decode($request['data'], TRUE);
return is_array($data) ? $data : array();
}