本文整理匯總了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;
}
}
}