From: Roland Häder Date: Thu, 29 Nov 2012 16:37:26 +0000 (+0000) Subject: Check against interface Compressor, not for methods X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cda1f46d8c402c14239ba96560375dcacd05f2c8;p=core.git Check against interface Compressor, not for methods --- diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index c1b213cf..8ca26e13 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -94,10 +94,10 @@ class CompressorChannel extends BaseMiddleware implements Registerable { if ( (is_null($compressorInstance->getCompressor())) || (!is_object($compressorInstance->getCompressor())) - || (!method_exists($compressorInstance->getCompressor(), 'compressStream')) - || (!method_exists($compressorInstance->getCompressor(), 'decompressStream')) + || (!$compressorInstance instanceof Compressor) ) { // Set the null compressor handler. This should not be configureable! + // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay? $compressorInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor')); } // END - if