From: Michael M Slusarz Date: Wed, 3 Jun 2009 02:50:57 +0000 (-0600) Subject: Don't maintain PHP based mime magic lookup anymore X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3883630c8e5fd633114c775a0a2aad6b75745012;p=horde.git Don't maintain PHP based mime magic lookup anymore --- diff --git a/framework/Mime/lib/Horde/Mime/Magic.php b/framework/Mime/lib/Horde/Mime/Magic.php index a945a62ee..4802cc261 100644 --- a/framework/Mime/lib/Horde/Mime/Magic.php +++ b/framework/Mime/lib/Horde/Mime/Magic.php @@ -47,21 +47,6 @@ class Horde_Mime_Magic } /** - * Returns a copy of the MIME magic file. - * - * @return array The MIME magic file. - */ - static protected function _getMimeMagicFile() - { - if (is_null(self::$_magic)) { - require dirname(__FILE__) . '/mime.magic.php'; - self::$_magic = $mime_magic; - } - - return self::$_magic; - } - - /** * Attempt to convert a file extension to a MIME type, based * on the global Horde and application specific config files. * @@ -196,26 +181,6 @@ class Horde_Mime_Magic return trim(mime_content_type($path)); } - /* Use a built-in magic file. */ - $mime_magic = self::_getMimeMagicFile(); - if (!($fp = @fopen($path, 'rb'))) { - return false; - } - - reset($mime_magic); - while (list($offset, $odata) = each($mime_magic)) { - reset($odata); - while (list($length, $ldata) = each($odata)) { - @fseek($fp, $offset, SEEK_SET); - $lookup = @fread($fp, $length); - if (!empty($ldata[$lookup])) { - fclose($fp); - return $ldata[$lookup]; - } - } - } - fclose($fp); - return false; } @@ -256,19 +221,6 @@ class Horde_Mime_Magic return $type; } - /* Use a built-in magic file. */ - $mime_magic = self::_getMimeMagicFile(); - reset($mime_magic); - while (list($offset, $odata) = each($mime_magic)) { - reset($odata); - while (list($length, $ldata) = each($odata)) { - $lookup = substr($data, $offset, $length); - if (!empty($ldata[$lookup])) { - return $ldata[$lookup]; - } - } - } - return false; } } diff --git a/framework/Mime/lib/Horde/Mime/mime.magic.php b/framework/Mime/lib/Horde/Mime/mime.magic.php deleted file mode 100644 index 0ee89d226..000000000 Binary files a/framework/Mime/lib/Horde/Mime/mime.magic.php and /dev/null differ diff --git a/framework/Mime/package.xml b/framework/Mime/package.xml index fea92bcb7..36c8a2a18 100644 --- a/framework/Mime/package.xml +++ b/framework/Mime/package.xml @@ -96,7 +96,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> -