/home/techb158/ileadtechnology.com/vendor/league/glide/src/Responses
Edit: /home/techb158/ileadtechnology.com/vendor/league/glide/src/Responses/PsrResponseFactory.php (2052B)
response = $response;
$this->streamCallback = $streamCallback;
}
/**
* Create response.
*
* @param FilesystemInterface $cache Cache file system.
* @param string $path Cached file path.
*
* @return ResponseInterface Response object.
*/
public function create(FilesystemInterface $cache, $path)
{
$stream = $this->streamCallback->__invoke(
$cache->readStream($path)
);
$contentType = $cache->getMimetype($path);
$contentLength = (string) $cache->getSize($path);
$cacheControl = 'max-age=31536000, public';
$expires = date_create('+1 years')->format('D, d M Y H:i:s').' GMT';
if (false === $contentType) {
throw new FilesystemException('Unable to determine the image content type.');
}
if (false === $contentLength) {
throw new FilesystemException('Unable to determine the image content length.');
}
return $this->response->withBody($stream)
->withHeader('Content-Type', $contentType)
->withHeader('Content-Length', $contentLength)
->withHeader('Cache-Control', $cacheControl)
->withHeader('Expires', $expires);
}
}