protected function AssetImageHelper::checkRemoteThumbnailStatusCode in Media: Acquia DAM 8
Check if the remote URL matches the given status code.
Parameters
string $url: The URL to perform a HEAD request against.
int $statusCode: The status code to look for. Defaults to 403.
Return value
bool TRUE if the status code was a match.
1 call to AssetImageHelper::checkRemoteThumbnailStatusCode()
- AssetImageHelper::getThumbnailUrlBySize in src/
Service/ AssetImageHelper.php - Get the URL to the DAM-provided thumbnail if possible.
File
- src/
Service/ AssetImageHelper.php, line 149
Class
- AssetImageHelper
- Class AssetImageHelper.
Namespace
Drupal\media_acquiadam\ServiceCode
protected function checkRemoteThumbnailStatusCode($url, $statusCode = 403) {
$response = $this->httpClient
->head($url);
return !empty($response) && $response
->getStatusCode() == $statusCode;
}