/lib/ezfile/classes/ezgzipcompressionhandler.php
PHP | 59 lines | 28 code | 5 blank | 26 comment | 5 complexity | 0e439703893b70f4d83abf99229e410b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
- <?php
- /**
- * File containing the eZGZIPCompressionHandler class.
- *
- * @copyright Copyright (C) eZ Systems AS. All rights reserved.
- * @license For full copyright and license information view LICENSE file distributed with this source code.
- * @version //autogentag//
- * @package lib
- */
- /*!
- \class eZGZIPCompressionHandler ezgzipcompressionhandler.php
- \brief Handles files compressed with gzip
- This class is a wrapper of the eZGZIPZLIBCompressionHandler and
- eZGZIPShellCompressionHandler classes.
- Duplication of this handler is done by the eZForwardCompressionHandler class.
- */
- class eZGZIPCompressionHandler extends eZForwardCompressionHandler
- {
- /*!
- See eZCompressionHandler::eZCompressionHandler and eZForwardCompressionHandler::eZForwardCompressionHandler.
- */
- public function __construct()
- {
- if ( eZGZIPZLIBCompressionHandler::isAvailable() )
- $handler = new eZGZIPZLIBCompressionHandler();
- else if ( eZGZIPShellCompressionHandler::isAvailable() )
- $handler = new eZGZIPShellCompressionHandler();
- else
- $handler = new eZNoCompressionHandler();
- parent::__construct( $handler, 'GZIP', 'gzip' );
- }
- /*!
- Forwards the compression level to the current handler.
- */
- function setCompressionLevel( $level )
- {
- $handler =& $this->handler();
- if ( method_exists( $handler, 'setCompressionLevel' ) )
- $handler->setCompressionLevel( $level );
- }
- /*!
- Forwards the request for compression level to the current handler and returns the value.
- */
- function compressionLevel()
- {
- $handler =& $this->handler();
- if ( method_exists( $handler, 'compressionLevel' ) )
- return $handler->compressionLevel();
- return false;
- }
- }
- ?>