]> git.mxchange.org Git - mailer.git/blobdiff - inc/classes/middleware/compressor/class_CompressorChannel.php
Code merge from latest Ship-Simu code
[mailer.git] / inc / classes / middleware / compressor / class_CompressorChannel.php
index 858401fb37b24d3a41b89e2b1145d5062a46771f..e48e091a3784c2d201cc389c83953514896dada6 100644 (file)
@@ -1,16 +1,37 @@
 <?php
-// Kompressor-Auswahl Klasse
+/**
+ * Middleware class for selecting the right compressor channel
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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 <http://www.gnu.org/licenses/>.
+ */
 class CompressorChannel extends BaseMiddleware {
        // Output handler instance
        private $compressor = null;
 
        // Public constructor
-       private function __construct () {
+       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();
@@ -34,7 +55,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.
@@ -77,10 +98,10 @@ 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
                return $cInstance;
        }