|
|
@ -86,31 +86,24 @@ class File |
|
|
|
) |
|
|
|
) |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
$this->_connection->setMime( |
|
|
|
// Detect MIME type |
|
|
|
strval( |
|
|
|
switch (true) |
|
|
|
mime_content_type( |
|
|
|
|
|
|
|
$address->getPath() |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Filesystem::MIME_TEXT_PLAIN == $this->_connection->getMime()) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
$extension = pathinfo( |
|
|
|
case $mime = Filesystem::getMimeByPath( |
|
|
|
strval( |
|
|
|
$address->getPath() |
|
|
|
$address->getPath() |
|
|
|
): break; |
|
|
|
), |
|
|
|
|
|
|
|
PATHINFO_EXTENSION |
|
|
|
case $mime = mime_content_type( |
|
|
|
); |
|
|
|
$address->getPath() |
|
|
|
|
|
|
|
): break; |
|
|
|
|
|
|
|
|
|
|
|
if (in_array($extension, ['gmi', 'gemini'])) |
|
|
|
default: $mime = Filesystem::MIME_TEXT_GEMINI; |
|
|
|
{ |
|
|
|
|
|
|
|
$this->_connection->setMime( |
|
|
|
|
|
|
|
Filesystem::MIME_TEXT_GEMINI |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->_connection->setMime( |
|
|
|
|
|
|
|
$mime |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|