コード例 #1
0
ファイル: Basic.php プロジェクト: seytar/psx
 protected function sendBody(ResponseInterface $response)
 {
     if ($response->getBody() !== null) {
         $transferEncoding = $response->getHeader('Transfer-Encoding');
         $contentEncoding = $response->getHeader('Content-Encoding');
         if ($transferEncoding == 'chunked') {
             $this->sendContentChunked($response);
         } else {
             $this->sendContentEncoded($contentEncoding, $response);
         }
     }
 }
コード例 #2
0
ファイル: StaticCache.php プロジェクト: seytar/psx
 /**
  * Returns an array containing all headers which gets saved in the cache
  *
  * @param \PSX\Http\ResponseInterface $response
  * @return array
  */
 protected function getCacheHeaders(ResponseInterface $response)
 {
     $headers = array('Last-Modified' => date(DateTime::HTTP));
     if ($response->hasHeader('Content-Type')) {
         $headers['Content-Type'] = $response->getHeader('Content-Type');
     }
     return $headers;
 }