- Splitted cronard definitions

- Added TMP_PATH env var
- Added support for Events from attributes
- Added Negundo client support
This commit is contained in:
mcndave committed 2023-03-29 13:59:59 +00:00
1 parent 946281c884
commit f482c19df5
23 files changed
+163 -82

No files matched your search

+11 -2
View File
@@ -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)
);
}