- Splitted cronard definitions
- Added TMP_PATH env var - Added support for Events from attributes - Added Negundo client support
This commit is contained in:
1 parent
946281c884
commit
f482c19df5
23 files changed
+163
-82
No files matched your search
@@ -36,11 +36,20 @@ class FileDownloadResponse extends Response
|
||||
public function __construct($filepath, int $status = 200, array $headers = [])
|
||||
{
|
||||
$body = $this->createBody($filepath);
|
||||
|
||||
|
||||
if (class_exists(\Mimey\MimeTypes::class)) {
|
||||
$mime = (new \Mimey\MimeTypes())->getMimeType(pathinfo($filepath, PATHINFO_EXTENSION));
|
||||
}
|
||||
else {
|
||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime = finfo_file($finfo, $filepath);
|
||||
finfo_close($finfo);
|
||||
}
|
||||
|
||||
parent::__construct(
|
||||
$body,
|
||||
$status,
|
||||
$this->injectContentType( (new \Mimey\MimeTypes())->getMimeType( pathinfo($filepath, PATHINFO_EXTENSION) ), $headers)
|
||||
$this->injectContentType($mime, $headers)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user