diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-02-08 19:19:05 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-02-08 19:27:29 +0100 |
commit | d1b0ac39be8fddf90e4ebb7acf38d3a15590cf9b (patch) | |
tree | c12724a4330ad2886926c4a3fa4d33bd9e2ebfac /application/models/mfile.php | |
parent | 3a875bcaaa4986e113438bd34117b3901572b09e (diff) |
Add some mimetypes and sort the list
fileinfo uses some different mimetypes than File::MimeInfo. This tries
to add most of those that are currently on paste.xinu.at.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/models/mfile.php')
-rw-r--r-- | application/models/mfile.php | 73 |
1 files changed, 41 insertions, 32 deletions
diff --git a/application/models/mfile.php b/application/models/mfile.php index 3d0bda374..3e564d1dc 100644 --- a/application/models/mfile.php +++ b/application/models/mfile.php @@ -260,48 +260,57 @@ class Mfile extends CI_Model { private function mime2lexer($type) { $typearray = array( - 'text/plain' => 'text', + 'application/javascript' => 'javascript', + 'application/mbox' => 'text', + 'application/smil' => 'ocaml', + 'application/x-applix-spreadsheet' => 'actionscript', + 'application/x-awk' => 'awk', + 'application/x-desktop' => 'text', + 'application/x-fluid' => 'text', + 'application/x-genesis-rom' => 'text', + 'application/x-java' => 'java', + 'application/x-m4' => 'text', + 'application/xml-dtd' => "xml", + 'application/xml' => 'xml', + 'application/x-perl' => 'perl', + 'application/x-php' => 'php', + 'application/x-ruby' => 'ruby', + 'application/x-shellscript' => 'bash', + 'application/xslt+xml' => "xml", + 'application/x-x509-ca-cert' => 'text', + 'message/rfc822' => 'text', + 'text/css' => 'css', + 'text/html' => 'xml', 'text/plain-ascii' => 'ascii', - 'text/x-python' => 'python', - 'text/x-csrc' => 'c', - 'text/x-chdr' => 'c', + 'text/plain' => 'text', + 'text/troff' => 'groff', + 'text/x-asm' => 'nasm', + 'text/x-awk' => 'awk', + 'text/x-c' => 'c', + 'text/x-c++' => 'cpp', 'text/x-c++hdr' => 'c', + 'text/x-chdr' => 'c', + 'text/x-csrc' => 'c', 'text/x-c++src' => 'cpp', - 'text/x-patch' => 'diff', 'text/x-diff' => 'diff', - 'text/x-lua' => 'lua', - 'text/x-java' => 'java', + 'text/x-gawk' => 'awk', 'text/x-haskell' => 'haskell', + 'text/x-java' => 'java', + 'text/x-lisp' => 'cl', 'text/x-literate-haskell' => 'haskell', - 'text/x-subviewer' => 'bash', - 'text/x-scheme' => 'scheme', + 'text/x-lua' => 'lua', 'text/x-makefile' => 'make', - #'text/x-log' => 'log', - 'text/html' => 'xml', - 'text/css' => 'css', 'text/x-ocaml' => 'ocaml', + 'text/x-patch' => 'diff', + 'text/x-perl' => 'perl', + 'text/x-php' => 'php', + 'text/x-python' => 'python', + 'text/x-ruby' => 'ruby', + 'text/x-scheme' => 'scheme', + 'text/x-shellscript' => 'bash', + 'text/x-subviewer' => 'bash', 'text/x-tcl' => 'tcl', 'text/x-tex' => 'tex', - 'message/rfc822' => 'text', - #'image/svg+xml' => 'xml', - 'application/x-perl' => 'perl', - 'application/xml' => 'xml', - 'application/xml-dtd' => "xml", - 'application/xslt+xml' => "xml", - 'application/javascript' => 'javascript', - 'application/smil' => 'ocaml', - 'application/x-desktop' => 'text', - 'application/x-m4' => 'text', - 'application/x-awk' => 'text', - 'application/x-fluid' => 'text', - 'application/x-java' => 'java', - 'application/x-php' => 'php', - 'application/x-ruby' => 'ruby', - 'application/x-shellscript' => 'bash', - 'application/x-x509-ca-cert' => 'text', - 'application/mbox' => 'text', - 'application/x-genesis-rom' => 'text', - 'application/x-applix-spreadsheet' => 'actionscript' ); if (array_key_exists($type, $typearray)) return $typearray[$type]; |