namespace Org\Mxchange\CoreFramework\Middleware\Compressor;
// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Compressor\Compressor;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
use Org\Mxchange\CoreFramework\Registry\Registerable;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
-<<<<<<< HEAD:framework/main/middleware/compressor/class_CompressorChannel.php
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
-=======
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
->>>>>>> Some updates::inc/main/middleware/compressor/class_CompressorChannel.php
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*
* @return void
*/
- protected function __construct () {
+ private function __construct () {
// Call parent constructor!
parent::__construct(__CLASS__);
}
) {
// Init base directory
$baseDir =
- $compressorInstance->getConfigInstance()->getConfigEntry('framework_base_path') .
- $compressorInstance->getConfigInstance()->getConfigEntry('compressor_base_path');
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('framework_base_path') .
+ FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compressor_base_path');
// Get a directory pointer
$directoryInstance = ObjectFactory::createObjectByConfiguredName('directory_class', array($baseDir));
// Read all directories but no sub directories, .htaccess files and NullCompressor class
- while ($directoryEntry = $directoryInstance->readDirectoryExcept(array('.htaccess', 'class_NullCompressor.php'))) {
+ while ($directoryEntry = $directoryInstance->readDirectoryExcept(array('class_NullCompressor.php'))) {
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COMPRESSOR[' . __METHOD__ . ':' . __LINE__ . ']: directoryEntry=' . $directoryEntry);
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COMPRESSOR: directoryEntry=' . $directoryEntry);
// Is this a class file?
if ((substr($directoryEntry, 0, 6) == 'class_') && (substr($directoryEntry, -4, 4) == '.php')) {
if (is_null($tempInstance)) {
// Then skip to the next one
continue;
- } // END - if
+ }
// Set the compressor
$compressorInstance->setCompressor($tempInstance);
// No more searches required because we have found a valid compressor stream
break;
- } // END - if
- } // END - while
+ }
+ }
// Close the directory
$directoryInstance->closeDirectory();
- } // END - if
+ }
// Check again if there is a compressor
if (
// 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('Org\Mxchange\CoreFramework\Compressor\Null\NullCompressor'));
- } // END - if
+ }
// Return the compressor instance
return $compressorInstance;