]> git.mxchange.org Git - core.git/commitdiff
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 6bcb51535ef8774d45d01915e0720458e35e4cd6..01ab8471d4ee37dfe52b45ca1b5d86c92d20c9e7 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 302057523e0011313ffc2bbc09afc2b45eaa6d5f..f306b320f5a12b3018de0e451bac5f14124265de 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 4c2f78801c48011e1f241b33a4f8eb2996b5e639..3708da836647be8c645f46afd2169ba91ae145bb 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 44f5371a8fef400612fe16688bc5f5faa4b61b50..ee76b54011daf57fc84f58190ed55bf68a737c25 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 1b7a69de88bc2730b89d11d9a425ab9b176688fd..44ccb77249f4d5131b02b2b3bc8a7a771647bd9c 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 d5ceac39b2aa84ec27ab7939f903d8b9ae751541..9d7b07e8d07c74e0388881e9f9236e7f56b1819c 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 d06283f378fe2a49cccd8c630bd36cde89d9fbe4..8cefb63dea3fa4a9acb11af4ad07be4569c528d4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Compression;
+namespace CoreFramework\Compressor;
 
 // Import framework stuff
 use CoreFramework\Generic\FrameworkInterface;
index 618e82f166183e48145d1cc63388c18457e62c1e..1e7bf82a9965dfbdd494d967a2f0ac5c919600f0 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 7ef989b5aefe0e3f67e7723d2b221c23c9d42b04..9c5395976ef4363d461fb1acdece75f341d1ed75 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;