🤖 Auto commit for release 'develop' on 2025-09-07

This commit is contained in:
JC5
2025-09-07 07:56:10 +02:00
parent 602df95f3c
commit 262f1bae34
93 changed files with 804 additions and 767 deletions

View File

@@ -128,6 +128,7 @@ class AttachmentHelper implements AttachmentHelperInterface
public function saveAttachmentFromApi(Attachment $attachment, string $content): bool
{
Log::debug(sprintf('Now in %s', __METHOD__));
try {
$resource = tmpfile();
} catch (FilesystemException $e) {
@@ -144,6 +145,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$path = stream_get_meta_data($resource)['uri'];
Log::debug(sprintf('Path is %s', $path));
try {
$result = fwrite($resource, $content);
} catch (FilesystemException $e) {
@@ -152,6 +154,7 @@ class AttachmentHelper implements AttachmentHelperInterface
return false;
}
Log::debug(sprintf('Wrote %d bytes to temp file.', $result));
try {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
} catch (FileinfoException $e) {
@@ -175,7 +178,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$this->uploadDisk->put($file, $content);
// update attachment.
$attachment->md5 = md5_file($path);
$attachment->md5 = md5_file($path);
$attachment->mime = $mime;
$attachment->size = strlen($content);
$attachment->uploaded = true;
@@ -237,7 +240,7 @@ class AttachmentHelper implements AttachmentHelperInterface
$attachment = new Attachment(); // create Attachment object.
$attachment->user()->associate($user);
$attachment->attachable()->associate($model);
$attachment->md5 = md5_file($file->getRealPath());
$attachment->md5 = md5_file($file->getRealPath());
$attachment->filename = $file->getClientOriginalName();
$attachment->mime = $file->getMimeType();
$attachment->size = $file->getSize();