You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
301 lines
10 KiB
301 lines
10 KiB
<?xml version="1.0" encoding="iso-8859-1"?> |
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
<head> |
|
<!-- template designed by Marco Von Ballmoos --> |
|
<title>Docs For Class MimeClass</title> |
|
<link rel="stylesheet" href="../../media/stylesheet.css" /> |
|
<script src="../../media/lib/classTree.js"></script> |
|
<script language="javascript" type="text/javascript"> |
|
var imgPlus = new Image(); |
|
var imgMinus = new Image(); |
|
imgPlus.src = "../../media/images/plus.png"; |
|
imgMinus.src = "../../media/images/minus.png"; |
|
|
|
function showNode(Node){ |
|
switch(navigator.family){ |
|
case 'nn4': |
|
// Nav 4.x code fork... |
|
var oTable = document.layers["span" + Node]; |
|
var oImg = document.layers["img" + Node]; |
|
break; |
|
case 'ie4': |
|
// IE 4/5 code fork... |
|
var oTable = document.all["span" + Node]; |
|
var oImg = document.all["img" + Node]; |
|
break; |
|
case 'gecko': |
|
// Standards Compliant code fork... |
|
var oTable = document.getElementById("span" + Node); |
|
var oImg = document.getElementById("img" + Node); |
|
break; |
|
} |
|
oImg.src = imgMinus.src; |
|
oTable.style.display = "block"; |
|
} |
|
|
|
function hideNode(Node){ |
|
switch(navigator.family){ |
|
case 'nn4': |
|
// Nav 4.x code fork... |
|
var oTable = document.layers["span" + Node]; |
|
var oImg = document.layers["img" + Node]; |
|
break; |
|
case 'ie4': |
|
// IE 4/5 code fork... |
|
var oTable = document.all["span" + Node]; |
|
var oImg = document.all["img" + Node]; |
|
break; |
|
case 'gecko': |
|
// Standards Compliant code fork... |
|
var oTable = document.getElementById("span" + Node); |
|
var oImg = document.getElementById("img" + Node); |
|
break; |
|
} |
|
oImg.src = imgPlus.src; |
|
oTable.style.display = "none"; |
|
} |
|
|
|
function nodeIsVisible(Node){ |
|
switch(navigator.family){ |
|
case 'nn4': |
|
// Nav 4.x code fork... |
|
var oTable = document.layers["span" + Node]; |
|
break; |
|
case 'ie4': |
|
// IE 4/5 code fork... |
|
var oTable = document.all["span" + Node]; |
|
break; |
|
case 'gecko': |
|
// Standards Compliant code fork... |
|
var oTable = document.getElementById("span" + Node); |
|
break; |
|
} |
|
return (oTable && oTable.style.display == "block"); |
|
} |
|
|
|
function toggleNodeVisibility(Node){ |
|
if (nodeIsVisible(Node)){ |
|
hideNode(Node); |
|
}else{ |
|
showNode(Node); |
|
} |
|
} |
|
</script> |
|
</head> |
|
<body> |
|
<div class="page-body"> |
|
<h2 class="class-name"><img src="../../media/images/Class_logo.png" |
|
alt=" Class" |
|
title=" Class" |
|
style="vertical-align: middle"> MimeClass</h2> |
|
|
|
<a name="sec-description"></a> |
|
<div class="info-box"> |
|
<div class="info-box-title">Description</div> |
|
<div class="nav-bar"> |
|
<span class="disabled">Description</span> | |
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>) |
|
|
|
</div> |
|
<div class="info-box-body"> |
|
<!-- ========== Info from phpDoc block ========= --> |
|
<p class="short-description">This class inspired by Chris Jean's work, here: http://chrisjean.com/2009/02/14/generating-mime-type-in-php-is-not-magic/</p> |
|
<p class="description"><p>It does some MIME trickery, inspired by the need to to deal with Openoffice and MS Office 2007 file formats -- which are often mis-interpreted by mime-magic, fileinfo, and the *nix `file` command.</p><p>In Drupal 6, we also make use of file_get_mimetype. See: http://api.drupal.org/api/function/file_get_mimetype/6 ... however this only provides a uni-directional lookup (ext->mime). While I don't have a specific use case for a mime->extension lookup, I think it's good to have in here.</p><p>Drupal 7 will have better mime handlers. See: http://api.drupal.org/api/function/file_default_mimetype_mapping/7</p></p> |
|
<p class="notes"> |
|
Located in <a class="field" href="_MimeClass.inc.html">/MimeClass.inc</a> (line <span class="field">29</span>) |
|
</p> |
|
|
|
|
|
<pre></pre> |
|
|
|
</div> |
|
</div> |
|
|
|
|
|
|
|
|
|
<a name="sec-method-summary"></a> |
|
<div class="info-box"> |
|
<div class="info-box-title">Method Summary</span></div> |
|
<div class="nav-bar"> |
|
<a href="#sec-description">Description</a> | |
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>) |
|
</div> |
|
<div class="info-box-body"> |
|
<div class="method-summary"> |
|
|
|
<div class="method-definition"> |
|
<img src="../../media/images/Constructor.png" alt=" "/> |
|
<span class="method-result">MimeClass</span> |
|
<a href="#__construct" title="details" class="method-name">__construct</a> |
|
() |
|
</div> |
|
|
|
<div class="method-definition"> |
|
<img src="../../media/images/Method.png" alt=" "/> |
|
<span class="method-result">void</span> |
|
<a href="#getType" title="details" class="method-name">getType</a> |
|
(<span class="var-type"></span> <span class="var-name">$filename</span>) |
|
</div> |
|
|
|
<div class="method-definition"> |
|
<img src="../../media/images/Method.png" alt=" "/> |
|
<span class="method-result">void</span> |
|
<a href="#get_extension" title="details" class="method-name">get_extension</a> |
|
(<span class="var-type"></span> <span class="var-name">$mime_type</span>, [<span class="var-type"></span> <span class="var-name">$debug</span> = <span class="var-default">FALSE</span>]) |
|
</div> |
|
|
|
<div class="method-definition"> |
|
<img src="../../media/images/Method.png" alt=" "/> |
|
<span class="method-result">void</span> |
|
<a href="#get_mimetype" title="details" class="method-name">get_mimetype</a> |
|
(<span class="var-type"></span> <span class="var-name">$filename</span>, [<span class="var-type"></span> <span class="var-name">$debug</span> = <span class="var-default">FALSE</span>]) |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<a name="sec-methods"></a> |
|
<div class="info-box"> |
|
<div class="info-box-title">Methods</div> |
|
<div class="nav-bar"> |
|
<a href="#sec-description">Description</a> | |
|
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>) |
|
|
|
</div> |
|
<div class="info-box-body"> |
|
<A NAME='method_detail'></A> |
|
<a name="method__construct" id="__construct"><!-- --></a> |
|
<div class="evenrow"> |
|
|
|
<div class="method-header"> |
|
<img src="../../media/images/Constructor.png" /> |
|
<span class="method-title">Constructor __construct</span> (line <span class="line-number">204</span>) |
|
</div> |
|
|
|
<!-- ========== Info from phpDoc block ========= --> |
|
<ul class="tags"> |
|
<li><span class="field">access:</span> public</li> |
|
</ul> |
|
|
|
<div class="method-signature"> |
|
<span class="method-result">MimeClass</span> |
|
<span class="method-name"> |
|
__construct |
|
</span> |
|
() |
|
</div> |
|
|
|
|
|
|
|
</div> |
|
<a name="methodgetType" id="getType"><!-- --></a> |
|
<div class="oddrow"> |
|
|
|
<div class="method-header"> |
|
<img src="../../media/images/Method.png" /> |
|
<span class="method-title">getType</span> (line <span class="line-number">221</span>) |
|
</div> |
|
|
|
<!-- ========== Info from phpDoc block ========= --> |
|
<p class="short-description">function: getType description: An alias to get_mimetype, for backwards-compatibility with our old mimetype class.</p> |
|
<ul class="tags"> |
|
<li><span class="field">access:</span> public</li> |
|
</ul> |
|
|
|
<div class="method-signature"> |
|
<span class="method-result">void</span> |
|
<span class="method-name"> |
|
getType |
|
</span> |
|
(<span class="var-type"></span> <span class="var-name">$filename</span>) |
|
</div> |
|
|
|
<ul class="parameters"> |
|
<li> |
|
<span class="var-type"></span> |
|
<span class="var-name">$filename</span> </li> |
|
</ul> |
|
|
|
|
|
</div> |
|
<a name="methodget_extension" id="get_extension"><!-- --></a> |
|
<div class="evenrow"> |
|
|
|
<div class="method-header"> |
|
<img src="../../media/images/Method.png" /> |
|
<span class="method-title">get_extension</span> (line <span class="line-number">267</span>) |
|
</div> |
|
|
|
<!-- ========== Info from phpDoc block ========= --> |
|
<p class="short-description">function: get_extension</p> |
|
<p class="description"><p>description: returns *one* valid file extension for a given $mime_type</p></p> |
|
<ul class="tags"> |
|
<li><span class="field">access:</span> public</li> |
|
</ul> |
|
|
|
<div class="method-signature"> |
|
<span class="method-result">void</span> |
|
<span class="method-name"> |
|
get_extension |
|
</span> |
|
(<span class="var-type"></span> <span class="var-name">$mime_type</span>, [<span class="var-type"></span> <span class="var-name">$debug</span> = <span class="var-default">FALSE</span>]) |
|
</div> |
|
|
|
<ul class="parameters"> |
|
<li> |
|
<span class="var-type"></span> |
|
<span class="var-name">$mime_type</span> </li> |
|
<li> |
|
<span class="var-type"></span> |
|
<span class="var-name">$debug</span> </li> |
|
</ul> |
|
|
|
|
|
</div> |
|
<a name="methodget_mimetype" id="get_mimetype"><!-- --></a> |
|
<div class="oddrow"> |
|
|
|
<div class="method-header"> |
|
<img src="../../media/images/Method.png" /> |
|
<span class="method-title">get_mimetype</span> (line <span class="line-number">229</span>) |
|
</div> |
|
|
|
<!-- ========== Info from phpDoc block ========= --> |
|
<p class="short-description">function: get_mimetype</p> |
|
<p class="description"><p>description: returns a mimetype associated with the file extension of $filename</p></p> |
|
<ul class="tags"> |
|
<li><span class="field">access:</span> public</li> |
|
</ul> |
|
|
|
<div class="method-signature"> |
|
<span class="method-result">void</span> |
|
<span class="method-name"> |
|
get_mimetype |
|
</span> |
|
(<span class="var-type"></span> <span class="var-name">$filename</span>, [<span class="var-type"></span> <span class="var-name">$debug</span> = <span class="var-default">FALSE</span>]) |
|
</div> |
|
|
|
<ul class="parameters"> |
|
<li> |
|
<span class="var-type"></span> |
|
<span class="var-name">$filename</span> </li> |
|
<li> |
|
<span class="var-type"></span> |
|
<span class="var-name">$debug</span> </li> |
|
</ul> |
|
|
|
|
|
</div> |
|
|
|
</div> |
|
</div> |
|
|
|
|
|
<p class="notes" id="credit"> |
|
Documentation generated on Thu, 14 Jul 2011 16:56:05 -0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a> |
|
</p> |
|
</div></body> |
|
</html> |