Exemplo n.º 1
0
 /**
  * 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;
         }
     }
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  *
  */
 public function testGetParameters()
 {
     $this->assertEquals(array(), MIME_Type::getParameters('text/plain'));
     //rest is tested in testParse()
 }
 /**
  * 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;
         }
     }
 }