summaryrefslogtreecommitdiff
path: root/src/lib/Mime.class.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-01-07 08:21:00 -0800
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-01-07 10:22:21 -0800
commit83e460cdc3fc09867a3adb48c3d0894579dd3050 (patch)
tree0771bd935b30971bf2c244b6f158ed7496b644e5 /src/lib/Mime.class.php
parent3d64793a1ee45857856be1cd71c3a0a040a3e869 (diff)
Refactor to separate the framework from the app; drop message stuff, this app is just user management. Add a json view for individual users
Diffstat (limited to 'src/lib/Mime.class.php')
-rw-r--r--src/lib/Mime.class.php45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/lib/Mime.class.php b/src/lib/Mime.class.php
deleted file mode 100644
index f37c1eb..0000000
--- a/src/lib/Mime.class.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-class Mime {
- public static $mimes = array(
- 'csv' => array(
- 'text/csv', 'text/x-csv',
- 'text/x-comma-separated-values',
- 'text/comma-separated-values',
- 'application/csv',
- 'application/excel', 'application/vnd.msexcel'),
- 'xhtml' => array('text/html', 'application/xhtml+xml'),
- 'html' => array('text/html', 'application/xhtml+xml'),
- 'bmp' => 'image/bmp',
- 'gif' => 'image/gif',
- 'jpeg' => array('image/jpeg', 'image/pjpeg'),
- 'jpg' => array('image/jpeg', 'image/pjpeg'),
- 'jpe' => array('image/jpeg', 'image/pjpeg'),
- 'png' => array('image/png', 'image/x-png'),
- 'tiff' => 'image/tiff',
- 'tif' => 'image/tiff',
- 'css' => 'text/css',
- 'htm' => 'text/html',
- 'txt' => 'text/plain',
- 'json' => array('application/json', 'text/json')
- );
-
- public static function ext2mime($ext) {
- $mimes = self::$mimes;
- $mime = $mimes[$ext];
- if (!is_array($mime)) $mime = array($mime);
- return $mime;
- }
- public static function mime2ext($my_mime) {
- $ret = array();
- foreach (self::mimes as $ext => $mime) {
- if (is_array($mime)) {
- $match = in_array($my_mime, $mime);
- } else {
- $match = $my_mime==$mime;
- }
- if ($match) $ret[] = $ext;
- }
- return $ret;
- }
-} \ No newline at end of file