Continued:
authorRoland Haeder <roland@mxchange.org>
Sat, 25 Feb 2017 16:23:04 +0000 (17:23 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
- all compressors now have own distinct namespace, so also the
  CompressorChannel class needs some fixing
- added "import" of Compressor
- added "import" of DatabaseConnection
- added "import" of DatabaseConnector

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
inc/database.php
inc/main/classes/class_BaseFrameworkSystem.php
inc/main/classes/compressor/class_Bzip2Compressor.php
inc/main/classes/compressor/class_GzipCompressor.php
inc/main/classes/compressor/class_NullCompressor.php
inc/main/classes/compressor/class_ZlibCompressor.php
inc/main/interfaces/compressor/class_Compressor.php
inc/main/middleware/compressor/class_CompressorChannel.php
inc/main/middleware/database/class_DatabaseConnection.php

index 6bcb515..01ab847 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 // Import framework stuff
 use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Connection\Database\DatabaseConnection;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Middleware\Debug\DebugMiddleware;
 
index 3020575..f306b32 100644 (file)
@@ -3,7 +3,9 @@
 namespace CoreFramework\Object;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Connection\Database\DatabaseConnection;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Criteria\Criteria;
 use CoreFramework\Criteria\Local\LocalSearchCriteria;
index 4c2f788..3708da8 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compressor;
+namespace CoreFramework\Compressor\Bzip2;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
index 44f5371..ee76b54 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compressor;
+namespace CoreFramework\Compressor\Gzip;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
index 1b7a69d..44ccb77 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compressor;
+namespace CoreFramework\Compressor\Null;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
index d5ceac3..9d7b07e 100644 (file)
@@ -1,8 +1,9 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compressor;
+namespace CoreFramework\Compressor\Zlib;
 
 // Import framework stuff
+use CoreFramework\Compressor\Compressor;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
index d06283f..8cefb63 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compression;
+namespace CoreFramework\Compressor;
 
 // Import framework stuff
 use CoreFramework\Generic\FrameworkInterface;
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
index 7ef989b..9c53959 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Connection\Database;
 
 // Import framework stuff
+use CoreFramework\Connector\Database\DatabaseConnector;
 use CoreFramework\Criteria\Criteria;
 use CoreFramework\Criteria\Storing\StoreableCriteria;
 use CoreFramework\Database\Backend\DatabaseBackend;