]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 19:19:46 +0000 (21:19 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 21 Aug 2025 19:19:46 +0000 (21:19 +0200)
- use `ObjectFactory::createObjectByConfiguredName()` for getting any class'
  name from configuration

framework/config-global.php
framework/main/middleware/compressor/class_CompressorChannel.php

index 6f019d43673e53256ab40d01a3f63326b3bd3944..864f6ed126b10e11f401de8379e49f3162295b5a 100644 (file)
@@ -133,6 +133,9 @@ $cfg->setConfigEntry('meta_keywords', 'test,test,test');
 // CFG: META-DESCRIPTION
 $cfg->setConfigEntry('meta_description', 'A description for your website');
 
+// CFG: NULL-COMPRESSOR-CLASS
+$cfg->setConfigEntry('null_compressor_class', 'Org\Mxchange\CoreFramework\Compressor\Null\NullCompressor');
+
 // CFG: CACHE-CLASS
 $cfg->setConfigEntry('cache_class', 'Org\Mxchange\CoreFramework\Cache\Memory\MemoryCache');
 
index f66276efd55cbdd71de14577301d006004b7e17c..6b1785509c01e39398c13917eb66e0004b2b76a5 100644 (file)
@@ -111,7 +111,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                if (!$compressorInstance->isCompressorSet()) {
                        // 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::class));
+                       $compressorInstance->setCompressor(ObjectFactory::createObjectByConfiguredName('null_compressor_class'));
                }
 
                // Return the compressor instance