Apache Zeta Components Manual :: File Source for gzdeflate.php

Source for file gzdeflate.php

Documentation is available at gzdeflate.php

  1. <?php
  2. /**
  3.  * File containing the ezcMvcGzDeflateResponseFilter class
  4.  *
  5.  * Licensed to the Apache Software Foundation (ASF) under one
  6.  * or more contributor license agreements.  See the NOTICE file
  7.  * distributed with this work for additional information
  8.  * regarding copyright ownership.  The ASF licenses this file
  9.  * to you under the Apache License, Version 2.0 (the
  10.  * "License"); you may not use this file except in compliance
  11.  * with the License.  You may obtain a copy of the License at
  12.  * 
  13.  *   http://www.apache.org/licenses/LICENSE-2.0
  14.  * 
  15.  * Unless required by applicable law or agreed to in writing,
  16.  * software distributed under the License is distributed on an
  17.  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  18.  * KIND, either express or implied.  See the License for the
  19.  * specific language governing permissions and limitations
  20.  * under the License.
  21.  *
  22.  * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
  23.  * @version //autogentag//
  24.  * @filesource
  25.  * @package MvcTools
  26.  */
  27.  
  28. /**
  29.  * Response filter that gz deflates the contents.
  30.  *
  31.  * @package MvcTools
  32.  * @version //autogentag//
  33.  * @mainclass
  34.  */
  35. class ezcMvcGzDeflateResponseFilter implements ezcMvcResponseFilter
  36. {
  37.     /**
  38.      * This function filters the $response by gz-deflating it.
  39.      *
  40.      * @param ezcMvcResponse $response 
  41.      */
  42.     public function filterResponseezcMvcResponse $response )
  43.     {
  44.         $response->body gzdeflate$response->body );
  45.         if !$response->content )
  46.         {
  47.             $response->content new ezcMvcResultContent;
  48.         }
  49.         $response->content->encoding 'deflate';
  50.     }
  51.  
  52.     /**
  53.      * Should not be called with any options, as this filter doesn't support any.
  54.      *
  55.      * @throws ezcMvcFilterHasNoOptionsException if the $options array is not
  56.      *  empty.
  57.      * @param array $options 
  58.      */
  59.     public function setOptionsarray $options )
  60.     {
  61.         if count$options ) )
  62.         {
  63.             throw new ezcMvcFilterHasNoOptionsException__CLASS__ );
  64.         }
  65.     }
  66. }
  67. ?>
Documentation generated by phpDocumentor 1.4.3