X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmiddleware%2Fcompressor%2Fclass_CompressorChannel.php;h=73305150e08c173a90a651dc81549f1ad6a20a4c;hb=6c783b879094b6385da1b0a0b802c779f4870d4a;hp=05fbad06ba59ace7c40a090953fbf1f72310e535;hpb=ff66822b5fb6a92f5dc8af55290ecb89ec7f1aaf;p=shipsimu.git diff --git a/inc/classes/middleware/compressor/class_CompressorChannel.php b/inc/classes/middleware/compressor/class_CompressorChannel.php index 05fbad0..7330515 100644 --- a/inc/classes/middleware/compressor/class_CompressorChannel.php +++ b/inc/classes/middleware/compressor/class_CompressorChannel.php @@ -1,12 +1,12 @@ - * @version 0.0 + * @version 0.0.0 * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,25 +19,37 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * along with this program. If not, see . */ class CompressorChannel extends BaseMiddleware { - // Output handler instance + /** + * Real compressor instance + */ private $compressor = null; - // Public constructor - private function __construct () { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { // Call parent constructor! - parent::constructor(__CLASS__); + parent::__construct(__CLASS__); // Set description - $this->setPartDescr("Komprimierungshandler"); + $this->setObjectDescription("Komprimierungshandler"); // Create an unique ID $this->createUniqueID(); } - // Create a new compressor channel based a given compression handler + /** + * Create a new compressor channel based a given base directory where + * we shall look for compressor classes + * + * @param $baseDir Directory which holds our compressor classes + * @return $cInstance A prepared instance of this class + */ public final static function createCompressorChannel ($baseDir) { // Get new instance $cInstance = new CompressorChannel(); @@ -55,7 +67,7 @@ class CompressorChannel extends BaseMiddleware { // Read all directories but no sub directories while ($dir = $dirPointer->readDirectoryExcept(array("..", ".", ".htaccess"))) { // Is this a class file? - if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == $cInstance->getConfigInstance()->readConfig("php_extension"))) { + if ((substr($dir, 0, 6) == "class_") && (substr($dir, -4, 4) == FrameworkConfiguration::getInstance()->readConfig('php_extension'))) { // Get the compressor's name. That's why you must name // your files like your classes and also that's why you // must keep on class in one file. @@ -98,8 +110,8 @@ class CompressorChannel extends BaseMiddleware { || (!method_exists($cInstance->getCompressor(), 'compressStream')) || (!method_exists($cInstance->getCompressor(), 'decompressStream')) ) { - // Set the null compressor handler - $cInstance->setCompressor(NullCompressor::createNullCompressor()); + // Set the null compressor handler. This should not be configureable! + $cInstance->setCompressor(ObjectFactory::createObjectByName('NullCompressor')); } // Return the compressor instance