예제 #1
0
파일: mime.php 프로젝트: bermi/akelos
 static function getMimeType($acceptables)
 {
     // we group by 'quality'
     $grouped_acceptables = array();
     foreach ($acceptables as $acceptable) {
         $grouped_acceptables[$acceptable['q']][] = $acceptable['type'];
     }
     foreach ($grouped_acceptables as $q => $array_with_acceptables_of_same_quality) {
         foreach (AkMimeType::getRegistered() as $mime_type => $our_mime_type) {
             foreach ($array_with_acceptables_of_same_quality as $acceptable) {
                 if ($mime_type == $acceptable) {
                     return $our_mime_type;
                 }
             }
         }
     }
     return AkMimeType::lookupMimeType('default');
 }