[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 3 if (!defined('e107_INIT')) { exit; } 4 5 // e107 requires PHP > 4.3.0, all functions that are used in e107, introduced in newer 6 // versions than that should be recreated in here for compatabilty reasons.. 7 8 if (!function_exists('file_put_contents')) { 9 /** 10 * @return int 11 * @param string $filename 12 * @param mixed $data 13 * @desc Write a string to a file 14 */ 15 function file_put_contents($filename, $data) { 16 if (($h = @fopen($filename, 'w+')) === false) { 17 return false; 18 } 19 if (($bytes = @fwrite($h, $data)) === false) { 20 return false; 21 } 22 fclose($h); 23 return $bytes; 24 } 25 } 26 27 if (!function_exists('stripos')) { 28 function stripos($haystack, $needle) { 29 $parts = explode(strtolower($needle), strtolower($haystack), 2); 30 if (count($parts) == 1) { 31 return false; 32 } 33 return strlen($parts[0]); 34 } 35 } 36 37 38 39 if(!function_exists("mime_content_type")){ 40 function mime_content_type($filename){ 41 42 $filename = basename($filename); 43 44 $mime[".zip"] = "application/x-zip-compressed"; 45 $mime[".gif"] = "image/gif"; 46 $mime[".png"] = "image/x-png"; 47 $mime[".jpg"] = "image/jpeg"; 48 $mime[".jpeg"] = "image/jpeg"; 49 $mime[".tif"] = "image/tiff"; 50 $mime[".tiff"] = "image/tiff"; 51 $mime[".pdf"] = "application/pdf"; 52 $mime[".hqx"] = "application/mac-binhex40"; 53 $mime[".doc"] = "application/msword"; 54 $mime[".dot"] = "application/msword"; 55 $mime[".exe"] = "application/octet-stream"; 56 $mime[".au"] = "audio/basic"; 57 $mime[".snd"] = "audio/basic"; 58 $mime[".mid"] = "audio/mid"; 59 $mime[".mp3"] = "audio/mpeg"; 60 $mime[".aif"] = "audio/x-aiff"; 61 $mime[".ra"] = "audio/x-pn-realaudio"; 62 $mime[".ram"] = "audio/x-pn-realaudio"; 63 $mime[".wav"] = "audio/x-wav"; 64 $mime[".bmp"] = "image/bmp"; 65 $mime[".ra"] = "audio/x-pn-realaudio"; 66 $mime[".htm"] = "text/html"; 67 $mime[".html"] = "text/html"; 68 $mime[".css"] = "text/css"; 69 $mime[".txt"] = "text/plain"; 70 $mime[".mov"] = "video/quicktime"; 71 $mime[".mpg"] = "video/mpeg"; 72 $mime[".asx"] = "video/x-ms-asf"; 73 $mime[".avi"] = "video/x-msvideo"; 74 75 $ext = strrchr($filename, '.'); 76 return $mime[$ext]; 77 } 78 } 79 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |