0
-function file_to_array($file, $format = false) {
0
- $data = file_get_contents($file);
0
- $format = extension_of_file($file);
0
- return call_user_func($format . '_decode', $data, true);
0
# files_on($path, $options = array())
0
# ===================================
0
@@ -71,32 +64,44 @@ function files_on($path, $options = array()) {
0
- creates a path to the given public resource
0
- where: the path relative to the public folder
0
- a string with the path
0
-function path($where) {
0
- return root . 'public' . DIRECTORY_SEPARATOR . $where;
0
-Sends the file specified by the path
0
- data => the data or the filename path
0
- options => array that specifies the sending process
0
+# send_file($data, $options = array())
0
+# ====================================
0
+# Sends the given content to the browser.
0
+# * data: The data or a filesystem path where retrieve the content to send to the browser.
0
+# * options: Options for the sending operation.
0
+# * filename: The filename to give to the browser when sending the content.
0
+# * type: The mime type to send to the browser.
0
+# * destination: The destination type of the sending operation. <inline> and <attachment> will send the file to the
0
+# browser to download. <file> will send the content to the filesystem. <string> will return the content data.
0
+# * cache: A boolean to tell the browser to cache the file.
0
+# * etag: etag to tell the browser.
0
+# * encoding: File download encoding.
0
+# * on string destination type, will return the content data.
0
function send_file($data, $options = array()) {
0
$options = array_merge(array('filename' => name_of_file($data), 'type' => 'application/octet-stream', 'destination' => 'attachment', 'cache' => true, 'etag' => false, 'encoding' => 'utf-8'), $options);
0
switch ($options['destination']) {
0
case 'inline': case 'attachment':
0
- if (file_exists($data)) $data = file_get_contents($data);
0
+ if (file_exists($data))
0
+ $data = file_get_contents($data);
0
header('Content-type: ' . $options['type'] . '; charset=' . $options['encoding']);
0
header('Content-Disposition: ' . $options['destination'] . '; filename="' . $options['filename'] . '"');
0
if (empty($options['cache'])) {
0
@@ -104,97 +109,27 @@ function send_file($data, $options = array()) {
0
header('Cache-Control: must-revalidate, post-check=0,pre-check=0');
0
header('Pragma: public');
0
- if ($options['etag']) header('ETag: "' . $options['etag'] . '"');
0
+ header('ETag: "' . $options['etag'] . '"');
0
if (preg_match('/^(\/|http|www|\?)/', $data)) {
0
- $fp = fopen(
'http://' . $_SERVER['SERVER_NAME'] . '/' .$path, 'r');
0
+ $fp = fopen(
url . $path, 'r');
0
- if (preg_match('/^(\/|http|www|\?)/', $data)) $data = file_get_contents($data);
0
+ if (preg_match('/^(\/|http|www|\?)/', $data))
0
+ $data = file_get_contents($data);
0
file_put_contents($options['filename'], $data);
0
- if (preg_match('/^(\/|http|www|\?)/', $data)) return file_get_contents($data);
0
+ if (preg_match('/^(\/|http|www|\?)/', $data))
0
+ return file_get_contents($data);
0
- get the path to the given source
0
- source: the file to get
0
- type: the type of file to get (css/js/img)
0
- the path (absolute or relative)
0
-function asset_path($source, $type) {
0
- if ($type == 'css') $pre_path = path('stylesheets');
0
- elseif ($type == 'js') $pre_path = path('javascripts');
0
- else $pre_path = path('images');
0
- $data = is_absolute_url($source) ? $source : $pre_path . DIRECTORY_SEPARATOR . $source;
0
- $outside = is_outside_the_web($source);
0
- if (!$outside && $type != 'img' && strpos($source, '.' . $type) === false) $data .= '.' . $type;
0
- get the url to the given source
0
- source: the file to get
0
- type: the type of file to get (css/js/img)
0
- the url (absolute or relative)
0
-function asset_url($source, $type) {
0
- if ($type == 'css') $pre_path = '/stylesheets/';
0
- elseif ($type == 'js') $pre_path = '/javascripts/';
0
- else $pre_path = '/images/';
0
- $data = is_absolute_url($source) ? $source : $pre_path . $source;
0
- $outside = is_outside_the_web($source);
0
- if (!$outside && $type != 'img' && strpos($source, '.' . $type) === false) $data .= '.' . $type;
0
- if (Environment::environment == 'development' && !$outside) $data .= '?' . create_hash();
0
-Function: is_absolute_url
0
- says if a file url is absolute
0
- file: the file to test
0
- true if it is an absolute url, false otherwise
0
-function is_absolute_url($file) {
0
- return preg_match('/^(\/|http|www)/', $file);
0
-Function: is_outside_the_web
0
- says if a file is outside of the web
0
- file: the file to test
0
- true if it is outside of the web, false otherwise
0
-function is_outside_the_web($file) {
0
- return preg_match('/^(http|www)/', $file);
0
@@ -266,36 +201,60 @@ function get_mime($extension) {
0
static $types = array();
0
- '' => 'application/EDI-Consent',
0
- '' => 'application/EDI-X12',
0
- '' => 'application/EDIFACT',
0
'' => 'application/activemessage',
0
'ez' => 'application/andrew-inset',
0
- '' => 'application/applefile',
0
+ 'application/applefile',
0
+ 'atom' => 'application/atom+xml',
0
'' => 'application/atomicmail',
0
+ '' => 'application/batch-smtp',
0
+ '' => 'application/beep+xml',
0
'' => 'application/cals-1840',
0
+ '' => 'application/cnrp+xml',
0
'' => 'application/commonground',
0
+ '' => 'application/cpl+xml',
0
'' => 'application/cybercash',
0
'' => 'application/dca-rft',
0
'' => 'application/dec-dx',
0
+ '' => 'application/dvcs',
0
+ '' => 'application/edi-consent',
0
+ '' => 'application/edifact',
0
+ '' => 'application/edi-x12',
0
'' => 'application/eshop',
0
+ '' => 'application/font-tdpfr',
0
+ '' => 'application/http',
0
'' => 'application/hyperstudio',
0
'' => 'application/iges',
0
+ '' => 'application/index',
0
+ '' => 'application/index.cmd',
0
+ '' => 'application/index.obj',
0
+ '' => 'application/index.response',
0
+ '' => 'application/index.vnd',
0
+ '' => 'application/iotp',
0
+ '' => 'application/ipp',
0
+ '' => 'application/isup',
0
'hqx' => 'application/mac-binhex40',
0
'cpt' => 'application/mac-compactpro',
0
'' => 'application/macwriteii',
0
'' => 'application/marc',
0
'' => 'application/mathematica',
0
+ 'mathml' => 'application/mathml+xml',
0
'doc' => 'application/msword',
0
'' => 'application/news-message-id',
0
'' => 'application/news-transmission',
0
+ '' => 'application/ocsp-request',
0
+ '' => 'application/ocsp-response',
0
'bin' => 'application/octet-stream',
0
'dms' => 'application/octet-stream',
0
'lha' => 'application/octet-stream',
0
'lzh' => 'application/octet-stream',
0
'exe' => 'application/octet-stream',
0
'class' => 'application/octet-stream',
0
+ 'so' => 'application/octet-stream',
0
+ 'dll' => 'application/octet-stream',
0
+ 'dmg' => 'application/octet-stream',
0
'oda' => 'application/oda',
0
+ 'ogg' => 'application/ogg',
0
+ 'application/parityfec',
0
'pdf' => 'application/pdf',
0
'' => 'application/pgp-encrypted',
0
'' => 'application/pgp-keys',
0
@@ -303,35 +262,77 @@ function get_mime($extension) {
0
'' => 'application/pkcs10',
0
'' => 'application/pkcs7-mime',
0
'' => 'application/pkcs7-signature',
0
+ '' => 'application/pkix-cert',
0
+ '' => 'application/pkix-crl',
0
+ '' => 'application/pkixcmp',
0
'ai' => 'application/postscript',
0
'eps' => 'application/postscript',
0
'ps' => 'application/postscript',
0
'' => 'application/prs.alvestrand.titrax-sheet',
0
'' => 'application/prs.cww',
0
'' => 'application/prs.nprend',
0
+ '' => 'application/prs.plucker',
0
+ '' => 'application/qsig',
0
+ 'rdf' => 'application/rdf+xml',
0
+ '' => 'application/reginfo+xml',
0
'' => 'application/remote-printing',
0
'' => 'application/riscos',
0
- 'rtf' => 'application/rtf',
0
+ '' => 'application/rtf',
0
+ '' => 'application/sdp',
0
'' => 'application/set-payment',
0
'' => 'application/set-payment-initiation',
0
'' => 'application/set-registration',
0
'' => 'application/set-registration-initiation',
0
'' => 'application/sgml',
0
'' => 'application/sgml-open-catalog',
0
+ '' => 'application/sieve',
0
'' => 'application/slate',
0
'smi' => 'application/smil',
0
'smil' => 'application/smil',
0
+ 'gram' => 'application/srgs',
0
+ 'grxml' => 'application/srgs+xml',
0
+ '' => 'application/timestamp-query',
0
+ '' => 'application/timestamp-reply',
0
+ '' => 'application/tve-trigger',
0
'' => 'application/vemmi',
0
- '' => 'application/vnd.3M.Post-it-Notes',
0
- '' => 'application/vnd.FloGraphIt',
0
+ '' => 'application/vnd.3gpp.pic-bw-large',
0
+ '' => 'application/vnd.3gpp.pic-bw-small',
0
+ '' => 'application/vnd.3gpp.pic-bw-var',
0
+ '' => 'application/vnd.3gpp.sms',
0
+ '' => 'application/vnd.3m.post-it-notes',
0
+ '' => 'application/vnd.accpac.simply.aso',
0
+ '' => 'application/vnd.accpac.simply.imp',
0
'' => 'application/vnd.acucobol',
0
+ '' => 'application/vnd.acucorp',
0
+ 'air' => 'application/vnd.adobe.air-application-installer-package+zip air',
0
+ '' => 'application/vnd.adobe.xfdf',
0
+ '' => 'application/vnd.aether.imp',
0
+ '' => 'application/vnd.amiga.ami',
0
'' => 'application/vnd.anser-web-certificate-issue-initiation',
0
'' => 'application/vnd.anser-web-funds-transfer-initiation',
0
'' => 'application/vnd.audiograph',
0
+ '' => 'application/vnd.blueice.multipass',
0
+ '' => 'application/vnd.bmi',
0
'' => 'application/vnd.businessobjects',
0
+ '' => 'application/vnd.canon-cpdl',
0
+ '' => 'application/vnd.canon-lips',
0
+ '' => 'application/vnd.cinderella',
0
'' => 'application/vnd.claymore',
0
- '' => 'application/vnd.comsocaller',
0
+ '' => 'application/vnd.commerce-battelle',
0
+ '' => 'application/vnd.commonspace',
0
+ '' => 'application/vnd.contact.cmsg',
0
+ '' => 'application/vnd.cosmocaller',
0
+ '' => 'application/vnd.criticaltools.wbs+xml',
0
+ '' => 'application/vnd.ctc-posml',
0
+ '' => 'application/vnd.cups-postscript',
0
+ '' => 'application/vnd.cups-raster',
0
+ '' => 'application/vnd.cups-raw',
0
+ '' => 'application/vnd.curl',
0
+ '' => 'application/vnd.cybank',
0
+ '' => 'application/vnd.data-vision.rdz',
0
'' => 'application/vnd.dna',
0
+ '' => 'application/vnd.dpgraph',
0
+ '' => 'application/vnd.dreamfactory',
0
'' => 'application/vnd.dxr',
0
'' => 'application/vnd.ecdis-update',
0
'' => 'application/vnd.ecowin.chart',
0
@@ -341,25 +342,58 @@ function get_mime($extension) {
0
'' => 'application/vnd.ecowin.seriesrequest',
0
'' => 'application/vnd.ecowin.seriesupdate',
0
'' => 'application/vnd.enliven',
0
+ '' => 'application/vnd.epson.esf',
0
+ '' => 'application/vnd.epson.msf',
0
+ '' => 'application/vnd.epson.quickanime',
0
'' => 'application/vnd.epson.salt',
0
+ '' => 'application/vnd.epson.ssf',
0
+ '' => 'application/vnd.ericsson.quickcall',
0
+ '' => 'application/vnd.eudora.data',
0
'' => 'application/vnd.fdf',
0
'' => 'application/vnd.ffsns',
0
+ '' => 'application/vnd.fints',
0
+ '' => 'application/vnd.flographit',
0
'' => 'application/vnd.framemaker',
0
+ '' => 'application/vnd.fsc.weblaunch',
0
'' => 'application/vnd.fujitsu.oasys',
0
'' => 'application/vnd.fujitsu.oasys2',
0
'' => 'application/vnd.fujitsu.oasys3',
0
'' => 'application/vnd.fujitsu.oasysgp',
0
'' => 'application/vnd.fujitsu.oasysprs',
0
+ '' => 'application/vnd.fujixerox.ddd',
0
'' => 'application/vnd.fujixerox.docuworks',
0
- '' => 'application/vnd.hp-HPGL',
0
- '' => 'application/vnd.hp-PCL',
0
- '' => 'application/vnd.hp-PCLXL',
0
+ '' => 'application/vnd.fujixerox.docuworks.binder',
0
+ '' => 'application/vnd.fut-misnet',
0
+ '' => 'application/vnd.grafeq',
0
+ '' => 'application/vnd.groove-account',
0
+ '' => 'application/vnd.groove-help',
0
+ '' => 'application/vnd.groove-identity-message',
0
+ '' => 'application/vnd.groove-injector',
0
+ '' => 'application/vnd.groove-tool-message',
0
+ '' => 'application/vnd.groove-tool-template',
0
+ '' => 'application/vnd.groove-vcard',
0
+ '' => 'application/vnd.hbci',
0
+ '' => 'application/vnd.hhe.lesson-player',
0
+ '' => 'application/vnd.hp-hpgl',
0
+ '' => 'application/vnd.hp-hpid',
0
'' => 'application/vnd.hp-hps',
0
- '' => 'application/vnd.ibm.MiniPay',
0
+ '' => 'application/vnd.hp-pcl',
0
+ '' => 'application/vnd.hp-pclxl',
0
+ '' => 'application/vnd.httphone',
0
+ '' => 'application/vnd.hzn-3d-crossword',
0
+ '' => 'application/vnd.ibm.afplinedata',
0
+ '' => 'application/vnd.ibm.electronic-media',
0
+ '' => 'application/vnd.ibm.minipay',
0
'' => 'application/vnd.ibm.modcap',
0
+ '' => 'application/vnd.ibm.rights-management',
0
+ '' => 'application/vnd.ibm.secure-container',
0
+ '' => 'application/vnd.informix-visionary',
0
'' => 'application/vnd.intercon.formnet',
0
'' => 'application/vnd.intertrust.digibox',
0
'' => 'application/vnd.intertrust.nncp',
0
+ '' => 'application/vnd.intu.qbo',
0
+ '' => 'application/vnd.intu.qfx',
0
+ '' => 'application/vnd.irepository.package+xml',
0
'' => 'application/vnd.is-xpr',
0
'' => 'application/vnd.japannet-directory-service',
0
'' => 'application/vnd.japannet-jpnstore-wakeup',
0
@@ -369,59 +403,150 @@ function get_mime($extension) {
0
'' => 'application/vnd.japannet-setstore-wakeup',
0
'' => 'application/vnd.japannet-verification',
0
'' => 'application/vnd.japannet-verification-wakeup',
0
+ '' => 'application/vnd.jisp',
0
+ '' => 'application/vnd.kde.karbon',
0
+ '' => 'application/vnd.kde.kchart',
0
+ '' => 'application/vnd.kde.kformula',
0
+ '' => 'application/vnd.kde.kivio',
0
+ '' => 'application/vnd.kde.kontour',
0
+ '' => 'application/vnd.kde.kpresenter',
0
+ '' => 'application/vnd.kde.kspread',
0
+ '' => 'application/vnd.kde.kword',
0
+ '' => 'application/vnd.kenameaapp',
0
'' => 'application/vnd.koan',
0
+ '' => 'application/vnd.liberty-request+xml',
0
+ '' => 'application/vnd.llamagraphics.life-balance.desktop',
0
+ '' => 'application/vnd.llamagraphics.life-balance.exchange+xml',
0
'' => 'application/vnd.lotus-1-2-3',
0
'' => 'application/vnd.lotus-approach',
0
'' => 'application/vnd.lotus-freelance',
0
+ '' => 'application/vnd.lotus-notes',
0
'' => 'application/vnd.lotus-organizer',
0
'' => 'application/vnd.lotus-screencam',
0
'' => 'application/vnd.lotus-wordpro',
0
+ '' => 'application/vnd.mcd',
0
+ '' => 'application/vnd.mediastation.cdkey',
0
'' => 'application/vnd.meridian-slingshot',
0
+ '' => 'application/vnd.micrografx.flo',
0
+ '' => 'application/vnd.micrografx.igx',
0
'mif' => 'application/vnd.mif',
0
'' => 'application/vnd.minisoft-hp3000-save',
0
'' => 'application/vnd.mitsubishi.misty-guard.trustweb',
0
+ '' => 'application/vnd.mobius.daf',
0
+ '' => 'application/vnd.mobius.dis',
0
+ '' => 'application/vnd.mobius.mbk',
0
+ '' => 'application/vnd.mobius.mqy',
0
+ '' => 'application/vnd.mobius.msl',
0
+ '' => 'application/vnd.mobius.plc',
0
+ '' => 'application/vnd.mobius.txf',
0
+ '' => 'application/vnd.mophun.application',
0
+ '' => 'application/vnd.mophun.certificate',
0
+ '' => 'application/vnd.motorola.flexsuite',
0
+ '' => 'application/vnd.motorola.flexsuite.adsi',
0
+ '' => 'application/vnd.motorola.flexsuite.fis',
0
+ '' => 'application/vnd.motorola.flexsuite.gotap',
0
+ '' => 'application/vnd.motorola.flexsuite.kmr',
0
+ '' => 'application/vnd.motorola.flexsuite.ttc',
0
+ '' => 'application/vnd.motorola.flexsuite.wem',
0
+ 'xul' => 'application/vnd.mozilla.xul+xml',
0
'' => 'application/vnd.ms-artgalry',
0
'' => 'application/vnd.ms-asf',
0
'xls' => 'application/vnd.ms-excel',
0
+ '' => 'application/vnd.ms-lrm',
0
'ppt' => 'application/vnd.ms-powerpoint',
0
'' => 'application/vnd.ms-project',
0
'' => 'application/vnd.ms-tnef',
0
'' => 'application/vnd.ms-works',
0
+ '' => 'application/vnd.ms-wpl',
0
+ '' => 'application/vnd.mseq',
0
+ '' => 'application/vnd.msign',
0
'' => 'application/vnd.music-niff',
0
'' => 'application/vnd.musician',
0
'' => 'application/vnd.netfpx',
0
'' => 'application/vnd.noblenet-directory',
0
'' => 'application/vnd.noblenet-sealer',
0
'' => 'application/vnd.noblenet-web',
0
- '' => 'application/vnd.novadigm.EDM',
0
- '' => 'application/vnd.novadigm.EDX',
0
- '' => 'application/vnd.novadigm.EXT',
0
+ '' => 'application/vnd.novadigm.edm',
0
+ '' => 'application/vnd.novadigm.edx',
0
+ '' => 'application/vnd.novadigm.ext',
0
+ '' => 'application/vnd.obn',
0
'' => 'application/vnd.osa.netdeploy',
0
+ '' => 'application/vnd.palm',
0
+ '' => 'application/vnd.pg.format',
0
+ '' => 'application/vnd.pg.osasli',
0
'' => 'application/vnd.powerbuilder6',
0
'' => 'application/vnd.powerbuilder6-s',
0
+ '' => 'application/vnd.powerbuilder7',
0
+ '' => 'application/vnd.powerbuilder7-s',
0
+ '' => 'application/vnd.powerbuilder75',
0
+ '' => 'application/vnd.powerbuilder75-s',
0
+ '' => 'application/vnd.previewsystems.box',
0
+ '' => 'application/vnd.publishare-delta-tree',
0
+ '' => 'application/vnd.pvi.ptid1',
0
+ '' => 'application/vnd.pwg-multiplexed',
0
+ '' => 'application/vnd.pwg-xhtml-print+xml',
0
+ '' => 'application/vnd.quark.quarkxpress',
0
'' => 'application/vnd.rapid',
0
+ '' => 'application/vnd.s3sms',
0
+ '' => 'application/vnd.sealed.net',
0
'' => 'application/vnd.seemail',
0
+ '' => 'application/vnd.shana.informed.formdata',
0
'' => 'application/vnd.shana.informed.formtemplate',
0
'' => 'application/vnd.shana.informed.interchange',
0
'' => 'application/vnd.shana.informed.package',
0
+ '' => 'application/vnd.smaf',
0
+ '' => 'application/vnd.sss-cod',
0
+ '' => 'application/vnd.sss-dtf',
0
+ '' => 'application/vnd.sss-ntf',
0
'' => 'application/vnd.street-stream',
0
'' => 'application/vnd.svd',
0
'' => 'application/vnd.swiftview-ics',
0
+ '' => 'application/vnd.triscape.mxs',
0
+ '' => 'application/vnd.trueapp',
0
'' => 'application/vnd.truedoc',
0
+ '' => 'application/vnd.ufdl',
0
+ '' => 'application/vnd.uplanet.alert',
0
+ '' => 'application/vnd.uplanet.alert-wbxml',
0
+ '' => 'application/vnd.uplanet.bearer-choice',
0
+ '' => 'application/vnd.uplanet.bearer-choice-wbxml',
0
+ '' => 'application/vnd.uplanet.cacheop',
0
+ '' => 'application/vnd.uplanet.cacheop-wbxml',
0
+ '' => 'application/vnd.uplanet.channel',
0
+ '' => 'application/vnd.uplanet.channel-wbxml',
0
+ '' => 'application/vnd.uplanet.list',
0
+ '' => 'application/vnd.uplanet.list-wbxml',
0
+ '' => 'application/vnd.uplanet.listcmd',
0
+ '' => 'application/vnd.uplanet.listcmd-wbxml',
0
+ '' => 'application/vnd.uplanet.signal',
0
+ '' => 'application/vnd.vcx',
0
+ '' => 'application/vnd.vectorworks',
0
+ '' => 'application/vnd.vidsoft.vidconference',
0
'' => 'application/vnd.visio',
0
- '' => 'application/vnd.webturbo',
0
- 'slc' => 'application/vnd.wap.slc',
0
- 'sic' => 'application/vnd.wap.sic',
0
+ '' => 'application/vnd.visionary',
0
+ '' => 'application/vnd.vividence.scriptfile',
0
+ '' => 'application/vnd.vsf',
0
+ '' => 'application/vnd.wap.sic',
0
+ '' => 'application/vnd.wap.slc',
0
+ 'wbxml' => 'application/vnd.wap.wbxml',
0
'wmlc' => 'application/vnd.wap.wmlc',
0
'wmlsc' => 'application/vnd.wap.wmlscriptc',
0
+ '' => 'application/vnd.webturbo',
0
'' => 'application/vnd.wrq-hp3000-labelled',
0
'' => 'application/vnd.wt.stf',
0
+ '' => 'application/vnd.wv.csp+wbxml',
0
'' => 'application/vnd.xara',
0
+ '' => 'application/vnd.xfdl',
0
+ '' => 'application/vnd.yamaha.hv-dic',
0
+ '' => 'application/vnd.yamaha.hv-script',
0
+ '' => 'application/vnd.yamaha.hv-voice',
0
'' => 'application/vnd.yellowriver-custom-menu',
0
+ 'vxml' => 'application/voicexml+xml',
0
+ '' => 'application/watcherinfo+xml',
0
+ '' => 'application/whoispp-query',
0
+ '' => 'application/whoispp-response',
0
'' => 'application/wita',
0
'' => 'application/wordperfect5.1',
0
'bcpio' => 'application/x-bcpio',
0
- 'bz2' => 'application/x-bzip2',
0
'vcd' => 'application/x-cdlink',
0
'pgn' => 'application/x-chess-pgn',
0
'' => 'application/x-compress',
0
@@ -433,17 +558,9 @@ function get_mime($extension) {
0
'dvi' => 'application/x-dvi',
0
'spl' => 'application/x-futuresplash',
0
'gtar' => 'application/x-gtar',
0
- 'gz' => 'application/x-gzip',
0
- 'tgz' => 'application/x-gzip',
0
+ '' => 'application/x-gzip',
0
'hdf' => 'application/x-hdf',
0
'js' => 'application/x-javascript',
0
- 'kwd' => 'application/x-kword',
0
- 'kwt' => 'application/x-kword',
0
- 'ksp' => 'application/x-kspread',
0
- 'kpr' => 'application/x-kpresenter',
0
- 'kpt' => 'application/x-kpresenter',
0
- 'chrt' => 'application/x-kchart',
0
- 'kil' => 'application/x-killustrator',
0
'skp' => 'application/x-koan',
0
'skd' => 'application/x-koan',
0
'skt' => 'application/x-koan',
0
@@ -451,7 +568,6 @@ function get_mime($extension) {
0
'latex' => 'application/x-latex',
0
'nc' => 'application/x-netcdf',
0
'cdf' => 'application/x-netcdf',
0
- 'rpm' => 'application/x-rpm',
0
'sh' => 'application/x-sh',
0
'shar' => 'application/x-shar',
0
'swf' => 'application/x-shockwave-flash',
0
@@ -472,28 +588,92 @@ function get_mime($extension) {
0
'ustar' => 'application/x-ustar',
0
'src' => 'application/x-wais-source',
0
'' => 'application/x400-bp',
0
- '' => 'application/xml',
0
+ 'xhtml' => 'application/xhtml+xml',
0
+ 'xht' => 'application/xhtml+xml',
0
+ 'xslt' => 'application/xslt+xml',
0
+ 'xml' => 'application/xml',
0
+ 'xsl' => 'application/xml',
0
+ 'dtd' => 'application/xml-dtd',
0
+ '' => 'application/xml-external-parsed-entity',
0
'zip' => 'application/zip',
0
'' => 'audio/32kadpcm',
0
'snd' => 'audio/basic',
0
+ '' => 'audio/dsr-es201108',
0
+ '' => 'audio/g.722.1',
0
+ '' => 'audio/g726-16',
0
+ '' => 'audio/g726-24',
0
+ '' => 'audio/g726-32',
0
+ '' => 'audio/g726-40',
0
+ '' => 'audio/gsm-efr',
0
'midi' => 'audio/midi',
0
+ '' => 'audio/mpa-robust',
0
+ '' => 'audio/mp4a-latm',
0
'mpga' => 'audio/mpeg',
0
+ '' => 'audio/parityfec',
0
+ '' => 'audio/prs.sid',
0
+ '' => 'audio/telephone-event',
0
+ '' => 'audio/vnd.3gpp.iufp',
0
+ '' => 'audio/vnd.cisco.nse',
0
+ '' => 'audio/vnd.cns.anp1',
0
+ '' => 'audio/vnd.cns.inf1',
0
+ '' => 'audio/vnd.digital-winds',
0
+ '' => 'audio/vnd.everad.plj',
0
+ '' => 'audio/vnd.lucent.voice',
0
+ '' => 'audio/vnd.nortel.vbk',
0
+ '' => 'audio/vnd.nuera.ecelp4800',
0
+ '' => 'audio/vnd.nuera.ecelp7470',
0
+ '' => 'audio/vnd.nuera.ecelp9600',
0
+ '' => 'audio/vnd.octel.sbc',
0
'' => 'audio/vnd.qcelp',
0
+ '' => 'audio/vnd.rhetorex.32kadpcm',
0
+ '' => 'audio/vnd.vmx.cvsd',
0
'aif' => 'audio/x-aiff',
0
'aiff' => 'audio/x-aiff',
0
'aifc' => 'audio/x-aiff',
0
+ '' => 'audio/x-alaw-basic',
0
+ 'm3u' => 'audio/x-mpegurl',
0
'ram' => 'audio/x-pn-realaudio',
0
- 'rm' => 'audio/x-pn-realaudio',
0
- 'ra' => 'audio/x-realaudio',
0
+ 'ra' => 'audio/x-pn-realaudio',
0
+ '' => 'audio/x-pn-realaudio-plugin',
0
+ 'rm' => 'application/vnd.rn-realmedia',
0
'wav' => 'audio/x-wav',
0
'pdb' => 'chemical/x-pdb',
0
- 'xyz' => 'chemical/x-pdb',
0
+ 'xyz' => 'chemical/x-xyz',
0
@@ -503,16 +683,31 @@ function get_mime($extension) {
0
'' => 'image/prs.btif',
0
+ '' => 'image/prs.pti',
0
+ 'svg' => 'image/svg+xml',
0
'tiff' => 'image/tiff',
0
+ '' => 'image/tiff-fx',
0
+ '' => 'image/vnd.cns.inf2',
0
+ 'djvu' => 'image/vnd.djvu',
0
+ 'djv' => 'image/vnd.djvu',
0
+ '' => 'image/vnd.fastbidsheet',
0
+ '' => 'image/vnd.fst',
0
+ '' => 'image/vnd.fujixerox.edmics-mmr',
0
+ '' => 'image/vnd.fujixerox.edmics-rlc',
0
+ '' => 'image/vnd.globalgraphics.pgb',
0
+ '' => 'image/vnd.mix',
0
+ '' => 'image/vnd.ms-modi',
0
'' => 'image/vnd.net-fpx',
0
'wbmp' => 'image/vnd.wap.wbmp',
0
'' => 'image/vnd.xiff',
0
'ras' => 'image/x-cmu-raster',
0
+ 'ico' => 'image/x-icon',
0
'pnm' => 'image/x-portable-anymap',
0
'pbm' => 'image/x-portable-bitmap',
0
'pgm' => 'image/x-portable-graymap',
0
@@ -528,12 +723,23 @@ function get_mime($extension) {
0
'' => 'message/partial',
0
'' => 'message/rfc822',
0
+ '' => 'message/s-http',
0
+ '' => 'message/sipfrag',
0
'iges' => 'model/iges',
0
'mesh' => 'model/mesh',
0
'silo' => 'model/mesh',
0
+ '' => 'model/vnd.flatland.3dml',
0
+ '' => 'model/vnd.gdl',
0
+ '' => 'model/vnd.gs-gdl',
0
+ '' => 'model/vnd.gtw',
0
+ '' => 'model/vnd.mts',
0
+ '' => 'model/vnd.parasolid.transmit.binary',
0
+ '' => 'model/vnd.parasolid.transmit.text',
0
+ '' => 'model/vnd.vtu',
0
'vrml' => 'model/vrml',
0
'' => 'multipart/alternative',
0
@@ -549,45 +755,80 @@ function get_mime($extension) {
0
'' => 'multipart/report',
0
'' => 'multipart/signed',
0
'' => 'multipart/voice-message',
0
+ 'ics' => 'text/calendar',
0
+ 'ifb' => 'text/calendar',
0
'' => 'text/directory',
0
+ 'html' => 'text/html',
0
+ '' => 'text/parityfec',
0
- 'yml' => 'text/plain',
0
'' => 'text/prs.lines.tag',
0
'' => 'text/rfc822-headers',
0
'rtx' => 'text/richtext',
0
'tsv' => 'text/tab-separated-values',
0
- '' => 'text/vnd.flatland.3dml',
0
+ '' => 'text/vnd.curl',
0
+ '' => 'text/vnd.dmclientscript',
0
'' => 'text/vnd.fmi.flexstor',
0
'' => 'text/vnd.in3d.3dml',
0
'' => 'text/vnd.in3d.spot',
0
+ '' => 'text/vnd.iptc.nitf',
0
+ '' => 'text/vnd.iptc.newsml',
0
'' => 'text/vnd.latex-z',
0
- 'sl' => 'text/vnd.wap.sl',
0
- 'si' => 'text/vnd.wap.si',
0
+ '' => 'text/vnd.motorola.reflex',
0
+ '' => 'text/vnd.ms-mediapackage',
0
+ '' => 'text/vnd.net2phone.commcenter.command',
0
+ '' => 'text/vnd.sun.j2me.app-descriptor',
0
+ '' => 'text/vnd.wap.si',
0
+ '' => 'text/vnd.wap.sl',
0
'wml' => 'text/vnd.wap.wml',
0
'wmls' => 'text/vnd.wap.wmlscript',
0
'etx' => 'text/x-setext',
0
+ '' => 'text/xml-external-parsed-entity',
0
+ '' => 'video/h263-1998',
0
+ '' => 'video/h263-2000',
0
+ '' => 'video/mp4v-es',
0
'mpeg' => 'video/mpeg',
0
+ '' => 'video/parityfec',
0
+ '' => 'video/pointer',
0
'qt' => 'video/quicktime',
0
'mov' => 'video/quicktime',
0
+ '' => 'video/smpte292m',
0
+ '' => 'video/vnd.fvt',
0
'' => 'video/vnd.motorola.video',
0
'' => 'video/vnd.motorola.videop',
0
+ 'mxu' => 'video/vnd.mpegurl',
0
+ 'm4u' => 'video/vnd.mpegurl',
0
+ '' => 'video/vnd.nokia.interleaved-multimedia',
0
+ '' => 'video/vnd.objectvideo',
0
'' => 'video/vnd.vivo',
0
'avi' => 'video/x-msvideo',
0
'movie' => 'video/x-sgi-movie',
0
- 'ice' => 'x-conference/x-cooltalk',
0
- 'html' => 'text/html',
0
+ 'ice' => 'x-conference/x-cooltalk'
0
return array_key_exists($extension, $types) ? $types[$extension] : false;