Lines Matching refs:type

78      * @param  string $type MIME type
81 function MIME_Type($type = false) argument
83 if ($type) {
84 $this->parse($type);
95 function parse($type) argument
97 $this->media = $this->getMedia($type);
98 $this->subType = $this->getSubType($type);
99 if (MIME_Type::hasParameters($type)) {
101 foreach (MIME_Type::getParameters($type) as $param) {
116 function hasParameters($type) argument
118 if (strstr($type, ';')) {
132 function getParameters($type) argument
135 $tmp = explode(';', $type);
146 * @param string $type MIME type string
150 function stripParameters($type) argument
152 if (strstr($type, ';')) {
153 return substr($type, 0, strpos($type, ';'));
155 return $type;
167 function getMedia($type) argument
169 $tmp = explode('/', $type);
181 function getSubType($type) argument
183 $tmp = explode('/', $type);
198 $type = strtolower($this->media.'/'.$this->subType);
201 $type .= '; '.$this->parameters[$key]->get();
204 return $type;
213 * @param string $type MIME type to check
217 function isExperimental($type) argument
219 if (substr(MIME_Type::getMedia($type), 0, 2) == 'x-' ||
220 substr(MIME_Type::getSubType($type), 0, 2) == 'x-') {
231 * @param string $type MIME type to check
235 function isVendor($type) argument
237 if (substr(MIME_Type::getSubType($type), 0, 4) == 'vnd.') {
247 * @param string $type MIME type to check
251 function isWildcard($type) argument
253 if ($type == '*/*' || MIME_Type::getSubtype($type) == '*') {
267 * @param string $type MIME type to check
270 function wildcardMatch($card, $type) argument
281 MIME_Type::getMedia($type)) {
333 $type = mime_content_type($file);
335 $type = MIME_Type::_fileAutoDetect($file);
341 if (PEAR::isError($type)) {
342 return $type;
346 if (!$type || !strlen($type)) {
351 if (MIME_Type::hasParameters($type) && !$params) {
352 $type = MIME_Type::stripParameters($type);
355 return $type;