From 8d4d90d445cc0b0032e0f76ab98cac5a5a29df66 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 4 Jul 2014 07:39:32 +0200 Subject: [PATCH] make mime_type_plaindetect work in .phar files --- src/phorkie/Repository/Post.php | 2 +- src/phorkie/Tool/MIME/Type/PlainDetect.php | 35 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/phorkie/Tool/MIME/Type/PlainDetect.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index c9f6a53..fbfea4b 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -232,7 +232,7 @@ class Repository_Post { $tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-'); file_put_contents($tmp, $content); - $type = \MIME_Type_PlainDetect::autoDetect($tmp); + $type = Tool_MIME_Type_PlainDetect::autoDetect($tmp); unlink($tmp); return $this->findExtForType($type); diff --git a/src/phorkie/Tool/MIME/Type/PlainDetect.php b/src/phorkie/Tool/MIME/Type/PlainDetect.php new file mode 100644 index 0000000..235046e --- /dev/null +++ b/src/phorkie/Tool/MIME/Type/PlainDetect.php @@ -0,0 +1,35 @@ + -- 2.30.2