From 9c09d495d88bd98eb65a2c3ed826524266b5c464 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Tue, 18 Mar 2025 11:51:18 +0100 Subject: [PATCH] MediaHandler.php: add file kind --- inc/Service/Media/MediaHandler.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/inc/Service/Media/MediaHandler.php b/inc/Service/Media/MediaHandler.php index f668e35e..cf61ffce 100644 --- a/inc/Service/Media/MediaHandler.php +++ b/inc/Service/Media/MediaHandler.php @@ -5,9 +5,27 @@ use Vichan\Data\ThumbGenerationResult; interface MediaHandler { + /** + * PHP file upload, + */ + public const FILE_KIND_UPLOADED = 0; + /** + * Temporary file that should be moved/copied elsewhere. + */ + public const FILE_KIND_TEMPORARY = 1; + /** + * Static vichan file. + */ + public const FILE_KIND_STATIC = 2; + /** + * Live file in use by vichan in some post. + */ + public const FILE_KIND_INSTALLED = 3; + + public function supportsMime(string $mime): bool; - public function openHandle(string $file_path, string $file_mime): mixed; + public function openHandle(string $file_path, string $file_mime, int $file_kind): mixed; /** * Generates a thumbnail from the given file.