コード例 #1
0
ファイル: plugin.php プロジェクト: nsine/webmail-lite
 /**
  * @param string $sFontName
  * @return string
  */
 public function GetFont($sFontName)
 {
     $sFontFileName = $this->oPluginManager->GetFont($this->sName, $sFontName);
     if ($sFontFileName) {
         $sContentType = \MailSo\Base\Utils::MimeContentType($sFontFileName);
         $sType = \MailSo\Base\Utils::ContentTypeType($sContentType, $sFontFileName);
         if ('font' === $sType) {
             @header('Content-Type: ' . $sContentType);
             //				@header('Content-Disposition: attachment; filename="' . $sFontName . '"');
             $sFilePath = $sFontFileName;
             if (file_exists($sFilePath)) {
                 return file_get_contents($sFilePath);
             } else {
                 if (function_exists('http_response_code')) {
                     \http_response_code(404);
                 } else {
                     \header("HTTP/1.1 404 Not Found", true, 404);
                 }
             }
         }
     }
 }