コード例 #1
0
ファイル: Request.php プロジェクト: lionjsa/Barberry
 private static function extractOutputContentType($uri)
 {
     if (preg_match('@\\.([a-z0-9]+)$@i', $uri, $regs)) {
         try {
             return ContentType::byExtention($regs[1]);
         } catch (ContentType\Exception $e) {
         }
     }
     return null;
 }
コード例 #2
0
ファイル: FactoryTest.php プロジェクト: lionjsa/Barberry
 private static function factory($ext = 'jpg')
 {
     return new Factory(file_get_contents(__FILE__), ContentType::byExtention($ext));
 }