Continued:
[core.git] / inc / main / middleware / compressor / class_CompressorChannel.php
index 618e82f..1e7bf82 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Middleware\Compressor;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Middleware\BaseMiddleware;
 use CoreFramework\Registry\Registerable;
@@ -78,10 +79,19 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                                         * your files like your classes and also that's why you
                                         * must keep on class in one file.
                                         */
-                                       $className = substr($directoryEntry, 6, -4);
+
+                                       // Base name of compressor class
+                                       $baseClassName = substr($directoryEntry, 6, -4);
+
+                                       // Create full class name (with namespace
+                                       $fullClassName = sprintf(
+                                               'CoreFramework\Compressor\%s\%s',
+                                               str_replace('Compressor', '', $baseClassName),
+                                               $baseClassName
+                                       );
 
                                        // Get an instance from our object factory
-                                       $tempInstance = ObjectFactory::createObjectByName($className);
+                                       $tempInstance = ObjectFactory::createObjectByName($fullClassName);
 
                                        // Is it null?
                                        if (is_null($tempInstance)) {
@@ -109,7 +119,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable {
                ) {
                        // 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'));
+                       $compressorInstance->setCompressor(ObjectFactory::createObjectByName('CoreFramework\Compressor\Null\NullCompressor'));
                } // END - if
 
                // Return the compressor instance