本文整理汇总了PHP中MIME_Type::getParameters方法的典型用法代码示例。如果您正苦于以下问题:PHP MIME_Type::getParameters方法的具体用法?PHP MIME_Type::getParameters怎么用?PHP MIME_Type::getParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MIME_Type
的用法示例。
在下文中一共展示了MIME_Type::getParameters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
/**
* Parse a mime-type
*
* @param $type string MIME type to parse
* @return void
*/
function parse($type)
{
$this->media = $this->getMedia($type);
$this->subType = $this->getSubType($type);
if (MIME_Type::hasParameters($type)) {
require_once 'MIME/Type/Parameter.php';
foreach (MIME_Type::getParameters($type) as $param) {
$param =& new MIME_Type_Parameter($param);
$this->parameters[$param->name] = $param;
}
}
}
示例2: parse
/**
* Parse a mime-type and set the class variables.
*
* @param string $type MIME type to parse
*
* @return boolean True if the type has been parsed, false if not
*/
function parse($type)
{
if ($type instanceof PEAR_Error) {
return false;
}
$this->media = $this->getMedia($type);
$this->subType = $this->getSubType($type);
$this->parameters = array();
if (MIME_Type::hasParameters($type)) {
include_once 'MIME/Type/Parameter.php';
foreach (MIME_Type::getParameters($type) as $param) {
$param = new MIME_Type_Parameter($param);
$this->parameters[$param->name] = $param;
}
}
return true;
}
示例3: testGetParameters
/**
*
*/
public function testGetParameters()
{
$this->assertEquals(array(), MIME_Type::getParameters('text/plain'));
//rest is tested in testParse()
}
示例4: parse
/**
* Parse a mime-type
*
* @param $type string MIME type to parse
* @return void
*/
function parse($type)
{
global $mosConfig_absolute_path;
$this->media = $this->getMedia($type);
$this->subType = $this->getSubType($type);
if (MIME_Type::hasParameters($type)) {
require_once $mosConfig_absolute_path . '/components/com_zoom/lib/mime/mime_parameter.php';
foreach (MIME_Type::getParameters($type) as $param) {
$param =& new MIME_Type_Parameter($param);
$this->parameters[$param->name] = $param;
}
}
}