示例#1
0
文件: gzip.php 项目: bmdevel/ezc
 public function testFilter()
 {
     $response = new ezcMvcResponse();
     $response->body = 'Ze Body';
     $filter = new ezcMvcGzipResponseFilter();
     $filter->filterResponse($response);
     self::assertSame('gzip', $response->content->encoding);
     self::assertSame(gzencode('Ze Body'), $response->body);
 }
示例#2
0
文件: config.php 项目: jeanvoye/utb
 function runResponseFilters(ezcMvcRoutingInformation $routeInfo, ezcMvcRequest $request, ezcMvcResult $result, ezcMvcResponse $response)
 {
     if (!ezcBase::inDevMode()) {
         if (in_array('gzip', $request->accept->encodings)) {
             $filter = new ezcMvcGzipResponseFilter();
             $filter->filterResponse($response);
         } else {
             if (in_array('deflate', $request->accept->encodings)) {
                 $filter = new ezcMvcGzDeflateResponseFilter();
                 $filter->filterResponse($response);
             }
         }
     }
 }