1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Delete mime_content_type() - supported in all suitable versions of PHP (and deprecated anyway)

This commit is contained in:
e107steved 2008-01-06 20:59:48 +00:00
parent 6250557a29
commit 92ad2b1d2e

View File

@ -5,7 +5,9 @@ if (!defined('e107_INIT')) { exit; }
// e107 requires PHP > 4.3.0, all functions that are used in e107, introduced in newer
// versions than that should be recreated in here for compatabilty reasons..
if (!function_exists('file_put_contents')) {
// file_put_contents - introduced in PHP5
if (!function_exists('file_put_contents'))
{
/**
* @return int
* @param string $filename
@ -32,7 +34,8 @@ if (!function_exists('file_put_contents')) {
if (!function_exists('stripos')) {
if (!function_exists('stripos'))
{
function stripos($str,$needle,$offset=0)
{
return strpos(strtolower($str), strtolower($needle), $offset);
@ -40,45 +43,4 @@ if (!function_exists('stripos')) {
}
if(!function_exists("mime_content_type")){
function mime_content_type($filename){
$filename = basename($filename);
$mime[".zip"] = "application/x-zip-compressed";
$mime[".gif"] = "image/gif";
$mime[".png"] = "image/x-png";
$mime[".jpg"] = "image/jpeg";
$mime[".jpeg"] = "image/jpeg";
$mime[".tif"] = "image/tiff";
$mime[".tiff"] = "image/tiff";
$mime[".pdf"] = "application/pdf";
$mime[".hqx"] = "application/mac-binhex40";
$mime[".doc"] = "application/msword";
$mime[".dot"] = "application/msword";
$mime[".exe"] = "application/octet-stream";
$mime[".au"] = "audio/basic";
$mime[".snd"] = "audio/basic";
$mime[".mid"] = "audio/mid";
$mime[".mp3"] = "audio/mpeg";
$mime[".aif"] = "audio/x-aiff";
$mime[".ra"] = "audio/x-pn-realaudio";
$mime[".ram"] = "audio/x-pn-realaudio";
$mime[".wav"] = "audio/x-wav";
$mime[".bmp"] = "image/bmp";
$mime[".ra"] = "audio/x-pn-realaudio";
$mime[".htm"] = "text/html";
$mime[".html"] = "text/html";
$mime[".css"] = "text/css";
$mime[".txt"] = "text/plain";
$mime[".mov"] = "video/quicktime";
$mime[".mpg"] = "video/mpeg";
$mime[".asx"] = "video/x-ms-asf";
$mime[".avi"] = "video/x-msvideo";
$ext = strrchr($filename, '.');
return $mime[$ext];
}
}
?>