]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 7 Nov 2020 13:40:30 +0000 (14:40 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 7 Nov 2020 13:42:01 +0000 (14:42 +0100)
- monolithing BaseFrameworkSystem->getConfigInstance() is no more, best is to
  use FrameworkBootstrap::getConfigurationInstance() instead
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
45 files changed:
application/hub/classes/class_BaseHubSystem.php
application/hub/classes/client/http/class_HttpClient.p
application/hub/classes/client/http/class_HttpClient.ph
application/hub/classes/client/http/class_HttpClient.php
application/hub/classes/container/socket/class_SocketContainer.php
application/hub/classes/cruncher/class_BaseHubCruncher.php
application/hub/classes/cruncher/openssl/class_HubOpenSslCruncher.php
application/hub/classes/database/frontend/node/class_NodeDistributedHashTableDatabaseWrapper.php
application/hub/classes/dht/class_BaseDht.php
application/hub/classes/dht/node/class_NodeDhtFacade.php
application/hub/classes/factories/node/class_NodeObjectFactory.php
application/hub/classes/factories/socket/class_SocketFactory.php
application/hub/classes/feature/hubcoin_reward/class_HubcoinRewardFeature.php
application/hub/classes/filter/cruncher/class_CruncherInitializationFilter.php
application/hub/classes/filter/miner/class_MinerInitializationFilter.php
application/hub/classes/filter/miner/class_MinerPhpRequirementsFilter.php
application/hub/classes/filter/node/class_NodePhpRequirementsFilter.php
application/hub/classes/filter/task/crawler/class_CrawlerTaskHandlerInitializerFilter.php
application/hub/classes/handler/class_BaseHubHandler.php
application/hub/classes/handler/data/answer-status/announcement/class_NodeAnnouncementAnswerOkayHandler.php
application/hub/classes/handler/data/message-types/announcement/class_NodeMessageAnnouncementHandler.php
application/hub/classes/handler/data/message-types/dht/class_NodeMessageDhtBootstrapHandler.php
application/hub/classes/handler/data/message-types/requests/class_NodeMessageRequestNodeListHandler.php
application/hub/classes/helper/connection/class_BaseConnectionHelper.php
application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php
application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php
application/hub/classes/info/connection/class_ConnectionInfo.php
application/hub/classes/iterator/producer/keys/class_TestUnitKeyProducerIterator.php
application/hub/classes/listener/class_BaseListener.php
application/hub/classes/miner/chash/class_HubCoinMiner.php
application/hub/classes/miner/class_BaseHubMiner.php
application/hub/classes/nodes/boot/class_HubBootNode.php
application/hub/classes/nodes/class_BaseHubNode.php
application/hub/classes/package/fragmenter/class_PackageFragmenter.php
application/hub/classes/producer/class_BaseProducer.php
application/hub/classes/recipient/direct/class_DirectRecipient.php
application/hub/classes/recipient/upper/class_UpperRecipient.php
application/hub/classes/resolver/protocol/class_
application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php
application/hub/classes/source/units/class_TestUnitSource.php
application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php
application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php
application/hub/classes/template/class_BaseXmlTemplateEngine.php
application/hub/classes/tools/hub/class_HubTools.php
core

index db95f3288d1a88f6558484e478d2112d4ccb4178..3e4c41e1cbf185e452e4ac21b03b4ff5433faf92 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Generic;
 
 // Import application-specific stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Shipsimu\Hub\Container\Socket\StorableSocket;
 use Org\Shipsimu\Hub\Handler\Network\RawData\HandleableRawData;
 use Org\Shipsimu\Hub\Network\Delivery\Deliverable;
@@ -91,6 +92,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
                );
 
                // ... and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-SYSTEM: isset=%d - EXIT!', intval($isset)));
                return $isset;
        }
 
@@ -102,7 +104,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        protected final function setNodeId ($nodeId) {
                // Set it config now
-               $this->getConfigInstance()->setConfigEntry('node_id', (string) $nodeId);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('node_id', (string) $nodeId);
        }
 
        /**
@@ -112,7 +114,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        public final function getNodeId () {
                // Get it from config
-               return $this->getConfigInstance()->getConfigEntry('node_id');
+               return FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_id');
        }
 
        /**
@@ -123,7 +125,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        protected final function setPrivateKey (string $privateKey) {
                // Set it config now
-               $this->getConfigInstance()->setConfigEntry('private_key', (string) $privateKey);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('private_key', (string) $privateKey);
        }
 
        /**
@@ -133,7 +135,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        public final function getPrivateKey () {
                // Get it from config
-               return $this->getConfigInstance()->getConfigEntry('private_key');
+               return FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('private_key');
        }
 
        /**
@@ -144,7 +146,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        protected final function setNodePrivateKeyHash (string $privateKeyHash) {
                // Set it config now
-               $this->getConfigInstance()->setConfigEntry('private_key_hash', $privateKeyHash);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('private_key_hash', $privateKeyHash);
        }
 
        /**
@@ -154,7 +156,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         */
        public final function getNodePrivateKeyHash () {
                // Get it from config
-               return $this->getConfigInstance()->getConfigEntry('private_key_hash');
+               return FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('private_key_hash');
        }
 
        /**
@@ -164,7 +166,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         * @return      void
         */
        protected final function setSessionId (string $sessionId) {
-               $this->getConfigInstance()->setConfigEntry('session_id', $sessionId);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('session_id', $sessionId);
        }
 
        /**
@@ -173,7 +175,7 @@ abstract class BaseHubSystem extends BaseFrameworkSystem implements HubInterface
         * @return      $sessionId      Current session id
         */
        public final function getSessionId () {
-               return $this->getConfigInstance()->getConfigEntry('session_id');
+               return FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('session_id');
        }
 
        /**
index bfc535d33888376adfaa32f8a9be45227c7ae566..d61eab1530a4381682b650261550c92d9e88ace6 100644 (file)
@@ -5,12 +5,12 @@
                // Open connection
                if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ip = ConsoleTools::resolveIpAddress(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host'));
 
                        // @TODO Handle $ip = false
 
                        // Connect to host through proxy connection
-                       $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+                       $socketResource = fsockopen($ip, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } else {
                        // Connect to host directly
                        $socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
index cdd80f71919cf1f7a1bdbfbb999320c2fa445103..3c7605d774989fef8e16248736fb5344f3de684f 100644 (file)
                // Open connection
                if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ip = ConsoleTools::resolveIpAddress(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host'));
 
                        // @TODO Handle $ip = false
 
                        // Connect to host through proxy connection
-                       $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+                       $socketResource = fsockopen($ip, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } else {
                        // Connect to host directly
                        $socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
@@ -50,7 +50,7 @@
                // Do we use proxy?
                if ($helperInstance->isProxyUsed() === true) {
                        // CONNECT method?
-                       if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
+                       if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
                                // Setup proxy tunnel
                                $response = $helperInstance->setupProxyTunnel('shipsimu.org', 80, $socketResource);
 
index 78b4cf7ccf66a94055e94c2c428235b93b35d0ef..cf713c9cfa1b0f2d9d1f3f6ecc95b5ea96341e33 100644 (file)
@@ -2,6 +2,9 @@
 // Own namespace
 namespace Org\Mxchange\CoreFramework\Client\Http;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
 /**
  * A HTTP client class
  *
@@ -66,9 +69,9 @@ class HttpClient extends BaseClient implements Client {
                        // Determine it
                        $GLOBALS[__METHOD__] = (
                                (
-                                       $this->getConfigInstance()->getConfigEntry('proxy_host') != ''
+                                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_host') != ''
                                ) && (
-                                       $this->getConfigInstance()->getConfigEntry('proxy_port') > 0
+                                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_port') > 0
                                )
                        );
                } // END - if
@@ -115,9 +118,9 @@ class HttpClient extends BaseClient implements Client {
                $rawRequest .= 'Host: ' . $host . ':' . $port . self::HTTP_EOL;
 
                // Use login data to proxy? (username at least)
-               if ($this->getConfigInstance()->getConfigEntry('proxy_username') != '') {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') != '') {
                        // Add it as well
-                       $encodedAuth = base64_encode($this->getConfigInstance()->getConfigEntry('proxy_username') . ':' . $this->getConfigInstance()->getConfigEntry('proxy_password'));
+                       $encodedAuth = base64_encode(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_username') . ':' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('proxy_password'));
                        $rawRequest .= 'Proxy-Authorization: Basic ' . $encodedAuth . self::HTTP_EOL;
                } // END - if
 
index 8c4de84a62fbd864b1316c7cc2ae8e8ec780509f..db96217db3e10dfa3e5d8a66fa2e4a0be8c84eca 100644 (file)
@@ -15,6 +15,7 @@ use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
 use Org\Shipsimu\Hub\Handler\Package\NetworkPackageHandler;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -123,7 +124,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
                parent::__construct(__CLASS__);
 
                // Init value
-               $this->socketSelectTimeout = $this->getConfigInstance()->getConfigEntry('socket_select_timeout_usec');
+               $this->socketSelectTimeout = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('socket_select_timeout_usec');
 
                // Init array of connection types
                $this->connectionTypes = array(
@@ -798,7 +799,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
                 * PHP_NORMAL_READ, this line will endless block. This script does only
                 * provide simultanous or faked threads, not real.
                 */
-               $rawData = socket_read($this->getSocketResource(), $this->getConfigInstance()->getConfigEntry('tcp_buffer_length'), PHP_BINARY_READ);
+               $rawData = socket_read($this->getSocketResource(), FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('tcp_buffer_length'), PHP_BINARY_READ);
 
                // Return it
                /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s,rawData[%s]=%s - EXIT!', strtoupper($this->getSocketProtocol()), $this->getSocketResource(), gettype($rawData), $rawData));
@@ -843,9 +844,9 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
                $result = $this->setSocketOption(SOL_SOCKET, SO_RCVTIMEO, [
                        // Seconds
-                       'sec'  => $this->getConfigInstance()->getConfigEntry($this->getSocketProtocol() . '_socket_accept_wait_sec'),
+                       'sec'  => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getSocketProtocol() . '_socket_accept_wait_sec'),
                        // Milliseconds
-                       'usec' => $this->getConfigInstance()->getConfigEntry($this->getSocketProtocol() . '_socket_accept_wait_usec'),
+                       'usec' => FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getSocketProtocol() . '_socket_accept_wait_usec'),
                ]);
 
                // Return result
index 7aba23ca434537c97a85208c597ad608b8d2a098..cf07628252c35b99a2476424ae4ef7e2e60f56e3 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Factory\State\Cruncher\CruncherStateFactory;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Database\Updateable;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -113,7 +114,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable {
         */
        protected function isInBufferQueueFilled () {
                // Determine it
-               $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > $this->getConfigInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
+               $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cruncher_in_buffer_min_threshold'));
 
                // And return the result
                return $isFilled;
@@ -198,7 +199,7 @@ abstract class BaseHubCruncher extends BaseHubSystem implements Updateable {
                        $this->fillInBufferQueueWithWorkUnits();
 
                        // Is the buffer still not filled and are test-packages allowed?
-                       if ((!$this->isInBufferQueueFilled()) && ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'Y')) {
+                       if ((!$this->isInBufferQueueFilled()) && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cruncher_test_units_enabled') == 'Y')) {
                                // Then fill the in-buffer with (one) test-unit(s)
                                $this->fillInBufferQueueWithTestUnits();
                        } // END - if
index 455ee4e1b583b1ddd36034a116a7638ed60db657..43327051aceac274de6fbdababe10539a5d06980 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Cruncher\BaseHubCruncher;
 use Org\Shipsimu\Hub\Helper\Cruncher\CruncherHelper;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -74,7 +75,7 @@ class HubOpenSslCruncher extends BaseHubCruncher implements CruncherHelper, Regi
         */
        protected function fillInBufferQueueWithTestUnits () {
                // Are test units enabled?
-               if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
                        // They are disabled, so skip any further steps
                        return;
                } elseif ($this->getStateInstance()->isCruncherStateVirgin()) {
@@ -86,7 +87,7 @@ class HubOpenSslCruncher extends BaseHubCruncher implements CruncherHelper, Regi
                $generatorInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_generator_class');
 
                // We don't need an iterator here because we just need to generate some test units
-               for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
+               for ($idx = 0; $idx < FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
                        // Get a test unit from it
                        $unitInstance = $generatorInstance->generateNextUnitInstance();
 
index aec61b504eb6b41045ee9749f55200c605d4daff..35378613713dba98eb42b04c0bcbdc26c3791f3e 100644 (file)
@@ -643,7 +643,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-WRAPPER: CALLED!');
 
                // Get max recipients
-               $maxRecipients = $this->getConfigInstance()->getConfigEntry('max_dht_recipients');
+               $maxRecipients = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('max_dht_recipients');
 
                // First creata a search instance
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
@@ -682,7 +682,7 @@ class NodeDistributedHashTableDatabaseWrapper extends BaseHubDatabaseWrapper imp
                }
 
                // Get max recipients
-               $maxRecipients = $this->getConfigInstance()->getConfigEntry('max_dht_recipients');
+               $maxRecipients = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('max_dht_recipients');
 
                // First creata a search instance
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
index 20432b4a18d118d13567c70f3a82d2653379127d..5bbf61d7af19d967673143d40a8a66c5401721b1 100644 (file)
@@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 use Org\Shipsimu\Hub\Helper\Dht\HelpableDht;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
 
@@ -100,7 +101,7 @@ abstract class BaseDht extends BaseHubSystem implements Distributable {
         */
        public function updateDhtData () {
                // Set some dummy configuration entries, e.g. dht_status
-               $this->getConfigInstance()->setConfigEntry('dht_status', $this->getStateInstance()->getStateName());
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('dht_status', $this->getStateInstance()->getStateName());
        }
 
        /**
index 0eb971241dbc32f47f2bae09da0b71009aebea16..9ccb7920eaa37a850966a72c81a506cd27d720fc 100644 (file)
@@ -11,6 +11,7 @@ use Org\Shipsimu\Hub\Network\Message\DeliverableMessage;
 use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Handler\DataSet\HandleableDataSet;
@@ -322,7 +323,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                $searchInstance->addExcludeCriteria(str_replace('my-', '', $excludeKey), $messageData[$excludeKey]);
 
                // Only X entries are fine
-               $searchInstance->setLimit($this->getConfigInstance()->getConfigEntry('node_dht_list_limit'));
+               $searchInstance->setLimit(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_dht_list_limit'));
 
                // Run the query
                $resultInstance = $this->getWrapperInstance()->doSelectByCriteria($searchInstance);
index a08b7d21b22a4e663c6a89b40cdb5ce95df9aa95..0118b1f993bbce3450a0885ae8355b42e388f79e 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Factory\Node;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
@@ -63,7 +64,7 @@ class NodeObjectFactory extends ObjectFactory {
                } elseif (($requestInstance instanceof Requestable) && ($responseInstance instanceof Responseable)) {
                        // The default node-mode is from our configuration
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-FACTORY: requestInstance and responseInstance are both set.');
-                       $nodeMode = $factoryInstance->getConfigInstance()->getConfigEntry('node_default_mode');
+                       $nodeMode = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_default_mode');
 
                        // Is the node 'mode' parameter set?
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-FACTORY: nodeMode=%s - from CONFIG', $nodeMode));
index 3219a187727180ea2a45baaa116c24f4cfa7f77d..cbe224401b6ef4cc60a8251a98cdf1099bac9972 100644 (file)
@@ -107,7 +107,7 @@ class SocketFactory extends ObjectFactory {
         */
        public static final function createListenFileSocket (Listenable $listenerInstance) {
                // Create SplFileInfo
-               $fileInfo = new SplFileInfo($listenerInstance->getConfigInstance()->getConfigEntry('ipc_socket_file_name'));
+               $fileInfo = new SplFileInfo(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('ipc_socket_file_name'));
 
                // Create file name
                $socketFile = self::createTempPathForFile($fileInfo);
index 34410e81af4f4cdc5b07c57c0bc9fc638962116b..6f188dd6a16aed6d6da2747993d78f02fc36a19f 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Feature\CoinReward;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Feature\BaseFeature;
 use Org\Mxchange\CoreFramework\Feature\Feature;
 use Org\Mxchange\CoreFramework\Feature\FrameworkFeature;
@@ -64,7 +65,7 @@ class HubcoinRewardFeature extends BaseFeature implements Feature {
        public function isFeatureAvailable () {
                // Testing this feature is pretty simple:
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: CALLED!', __METHOD__, __LINE__));
-               $isAvailable = (($this->getConfigInstance()->getConfigEntry('extension_scrypt_loaded') === TRUE) && (extension_loaded('scrypt')) && (is_callable('scrypt')));
+               $isAvailable = ((FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('extension_scrypt_loaded') === TRUE) && (extension_loaded('scrypt')) && (is_callable('scrypt')));
 
                // Return status
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: isAvailable=%d - EXIT!', __METHOD__, __LINE__, intval($isAvailable)));
index 2457a7f5f1917626f1844c1a8bdde4f552ee5129..1679643149d3dd5905b32564f7ffc3cba3a0af34 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Cruncher\Filter\Initialization;
 use Org\Shipsimu\Hub\Cruncher\Filter\BaseCruncherFilter;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -68,7 +69,7 @@ class CruncherInitializationFilter extends BaseCruncherFilter implements Filtera
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // The default cruncher-mode is from our configuration
-               $cruncherMode = $this->getConfigInstance()->getConfigEntry('cruncher_default_mode');
+               $cruncherMode = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('cruncher_default_mode');
 
                // Is the cruncher 'mode' parameter set?
                if ($requestInstance->isRequestElementSet('mode')) {
index 74f7d3b60fad12b80f75c579cb5b288c6c73f680..b14646918af64cea5601bbfe09b8645ac4beb4e0 100644 (file)
@@ -2,16 +2,17 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Filter\Initialization;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Miner\Filter\BaseMinerFilter;
+
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Miner\Filter\BaseMinerFilter;
-
 /**
  * A Initialization filter for miners
  *
@@ -68,7 +69,7 @@ class MinerInitializationFilter extends BaseMinerFilter implements Filterable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // The default miner-mode is from our configuration
-               $minerMode = $this->getConfigInstance()->getConfigEntry('miner_default_mode');
+               $minerMode = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('miner_default_mode');
 
                // Is the miner 'mode' parameter set?
                if ($requestInstance->isRequestElementSet('mode')) {
index 05d7a7d6011cf4ccd478d172291e8c0f7bdbfdae..2ac4b90e60ee7b847ad679df2d9550c6c0834b26 100644 (file)
@@ -2,14 +2,15 @@
 // Own namespace
 namespace Org\Shipsimu\Hub\Miner\Filter\Requirements;
 
+// Import application-specific stuff
+use Org\Shipsimu\Hub\Miner\Filter\BaseMinerFilter;
+
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
 
-// Import application-specific stuff
-use Org\Shipsimu\Hub\Miner\Filter\BaseMinerFilter;
-
 /**
  * A PhpRequirements filter for miners
  *
@@ -81,7 +82,7 @@ class MinerPhpRequirementsFilter extends BaseMinerFilter implements Filterable {
                if ((extension_loaded('scrypt')) && (is_callable('scrypt'))) {
                        // Mark it as working
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.');
-                       $this->getConfigInstance()->setConfigEntry('extension_scrypt_loaded', TRUE);
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('extension_scrypt_loaded', TRUE);
                } else {
                        // Not working (not all have ext-scrypt installed
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.');
@@ -93,7 +94,5 @@ class MinerPhpRequirementsFilter extends BaseMinerFilter implements Filterable {
                        throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED);
                } // END - if
        }
-}
 
-// [EOF]
-?>
+}
index 1db2afe795132aaf5521cdca887bec94d59ab5f6..c4eee7dbcc01b52f998bcf8570c3a8fba02ac7df 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Filter\Node\Requirements;
 use Org\Shipsimu\Hub\Filter\Node\BaseNodeFilter;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Response\Responseable;
@@ -81,7 +82,7 @@ class NodePhpRequirementsFilter extends BaseNodeFilter implements Filterable {
                if ((extension_loaded('scrypt')) && (is_callable('scrypt'))) {
                        // Mark it as working
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-scrypt and a callable scrypt() function found. "Hubcoin reward" feature possible.');
-                       $this->getConfigInstance()->setConfigEntry('extension_scrypt_loaded', TRUE);
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('extension_scrypt_loaded', TRUE);
                } else {
                        // Not working (not all have ext-scrypt installed
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-scrypt not found or scrypt() function not found. "Hubcoin reward" feature disabled.');
@@ -91,7 +92,7 @@ class NodePhpRequirementsFilter extends BaseNodeFilter implements Filterable {
                if ((extension_loaded('uuid')) && (is_callable('uuid_create'))) {
                        // Mark it as working
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-uuid and a callable uuid_create() function found. UUID "entropy" available.');
-                       $this->getConfigInstance()->setConfigEntry('extension_uuid_loaded', TRUE);
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('extension_uuid_loaded', TRUE);
                } else {
                        // Not working (not all have ext-uuid installed
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ext-uuid not found or uuid_create() function not found. UUID "entropy" disabled.');
@@ -103,7 +104,5 @@ class NodePhpRequirementsFilter extends BaseNodeFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } // END - if
        }
-}
 
-// [EOF]
-?>
+}
index 46a41ad06e51feeae1c5b2c96aae4aa0eb91ab22..245447f0e610f337c9bdfc5090be5ec87dda3e29 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Filter\Initializer\Crawler\Handler\Task;
 use Org\Shipsimu\Hub\Crawler\Filter\BaseCrawlerFilter;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Filter\Filterable;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -115,7 +116,7 @@ class CrawlerTaskHandlerInitializerFilter extends BaseCrawlerFilter implements F
                $handlerInstance->registerTask('crawler_ping', $taskInstance);
 
                // 10) URL sources
-               foreach (explode(':', $this->getConfigInstance()->getConfigEntry('crawler_url_stacks')) as $stack) {
+               foreach (explode(':', FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crawler_url_stacks')) as $stack) {
                        // Init task instance
                        $taskInstance = ObjectFactory::createObjectByConfiguredName('crawler_url_source_' . $stack . '_task_class');
 
index 76f3903d41cd2182e5e2bc6a5d2572de772707cc..9d7a6a607c43a9e9c4aadc77fafdb69c40bcaabf 100644 (file)
@@ -16,6 +16,7 @@ use Org\Shipsimu\Hub\Pool\Poolable;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Handler\BaseHandler;
 use Org\Mxchange\CoreFramework\Handler\Handleable;
+use Org\Mxchange\CoreFramework\Registry\Register;
 
 /**
  * A general hub handler
@@ -70,6 +71,11 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
         */
        private $assemblerInstance = NULL;
 
+       /**
+        * Registry instance (implementing Register)
+        */
+       private $registryInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -89,12 +95,13 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
         */
        public final function ifStartEndMarkersSet ($data) {
                // Trace message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-HANDLER: data()=%d - CALLED!', strlen($data)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-HANDLER: data(%d)=%s - CALLED!', strlen($data), $data));
 
                // Determine it
                $isset = ((substr($data, 0, strlen(HandleableRawData::STREAM_START_MARKER)) == HandleableRawData::STREAM_START_MARKER) && (substr($data, -1 * strlen(HandleableRawData::STREAM_END_MARKER), strlen(HandleableRawData::STREAM_END_MARKER)) == HandleableRawData::STREAM_END_MARKER));
 
                // ... and return it
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-HANDLER: isset=%d - EXIT!', intval($isset)));
                return $isset;
        }
 
@@ -280,4 +287,23 @@ abstract class BaseHubHandler extends BaseHandler implements Handleable, HubInte
                return $this->assemblerInstance;
        }
 
+       /**
+        * Setter for registry instance
+        *
+        * @param       $registryInstance               An instance of a Register class
+        * @return      void
+        */
+       protected final function setRegistryInstance (Register $registryInstance) {
+               $this->registryInstance = $registryInstance;
+       }
+
+       /**
+        * Getter for registry instance
+        *
+        * @return      $registryInstance       The debug registry instance
+        */
+       protected final function getRegistryInstance () {
+               return $this->registryInstance;
+       }
+
 }
index 13ef618f1a74535eaf86a4a5400f37e1483858a7..809c9ff4812db694c40cd41b9471d70e54b26f01 100644 (file)
@@ -13,6 +13,7 @@ use Org\Shipsimu\Hub\Node\BaseHubNode;
 use Org\Shipsimu\Hub\Template\Engine\Xml\Answer\Announcement\XmlAnnouncementAnswerTemplateEngine;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -133,7 +134,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
                $objectList = $nodeInstance->getListFromAcceptedObjectTypes();
 
                // Add missing (temporary) configuration 'accepted_object_types'
-               $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS, implode(BaseHubNode::OBJECT_LIST_SEPARATOR, $objectList));
        }
 
        /**
@@ -145,7 +146,7 @@ class NodeAnnouncementAnswerOkayHandler extends BaseAnswerStatusHandler implemen
         */
        protected function removeMessageConfigurationData (DeliverableMessage $messageInstance) {
                // Remove temporay configuration
-               $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS);
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ACCEPTED_OBJECTS);
        }
 
 }
index d583bfd6cc4879d3154a76356b4af478bf93d14c..4da7d4b78bec8db13853dc650e1986fc5bf28caa 100644 (file)
@@ -14,6 +14,7 @@ use Org\Shipsimu\Hub\Template\Engine\Xml\Announcement\XmlAnnouncementTemplateEng
 use Org\Shipsimu\Hub\Template\Engine\Xml\Answer\Announcement\XmlAnnouncementAnswerTemplateEngine;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -165,7 +166,7 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]);
 
                        // Set the element in configuration
-                       $this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
                } // END - foreach
 
                // "Walk" throught the config-copy array
@@ -174,14 +175,14 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('ANNOUNCEMENT-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
 
                        // Copy from source to targetKey
-                       $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry($targetKey, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($sourceKey));
                } // END - foreach
 
                // Translate last exception into a status code
                $statusCode = $this->getTranslatedStatusFromLastException();
 
                // Set it in configuration (temporarily)
-               $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
        }
 
        /**
@@ -195,17 +196,17 @@ class NodeMessageAnnouncementHandler extends BaseMessageHandler implements Handl
                // "Walk" throught the translation array again
                foreach ($this->messageToConfig as $dummy => $configKey) {
                        // Now unset this configuration entry (to save some memory)
-                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+                       FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry($configKey);
                } // END - foreach
 
                // "Walk" throught the config-copy array again
                foreach ($this->configCopy as $configKey => $dummy) {
                        // Now unset this configuration entry (to save some memory again)
-                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+                       FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry($configKey);
                } // END - foreach
 
                // Remove NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS as well
-               $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
        }
 
 }
index f4950bf575c7da2052bd54d437c5b9034b55b875..e7c3da706dec971a839a425fe9b4f8ef9dddb1a6 100644 (file)
@@ -14,6 +14,7 @@ use Org\Shipsimu\Hub\Template\Engine\Xml\Answer\Dht\Bootstrap\XmlDhtBootstrapAns
 use Org\Shipsimu\Hub\Template\Engine\Xml\Dht\Bootstrap\XmlDhtBootstrapTemplateEngine;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -153,7 +154,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                foreach ($this->messageToConfig as $messageKey => $configKey) {
                        // Set the element in configuration
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTSTRAP-HANDLER: Setting messageKey=' . $messageKey . ',configKey=' . $configKey . ':' . $messageData[$messageKey]);
-                       $this->getConfigInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry($configKey, $messageData[$messageKey]);
                } // END - foreach
 
                // "Walk" throught the config-copy array
@@ -162,14 +163,14 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DHT-BOOTSTRAP-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
 
                        // Copy from source to target key
-                       $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry($targetKey, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($sourceKey));
                } // END - foreach
 
                // Translate last exception into a status code
                $statusCode = $this->getTranslatedStatusFromLastException();
 
                // Set it in configuration (temporarily)
-               $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
 
                /*
                 * Use the DHT instance to get a list of recipients. This means that all
@@ -183,7 +184,7 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                assert(count($nodeList) > 0);
 
                // Set it in configuration
-               $this->getConfigInstance()->setConfigEntry('dht_nodes', base64_encode(json_encode($nodeList)));
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('dht_nodes', base64_encode(json_encode($nodeList)));
        }
 
        /**
@@ -197,18 +198,18 @@ class NodeMessageDhtBootstrapHandler extends BaseMessageHandler implements Handl
                // "Walk" throught the translation array again
                foreach ($this->messageToConfig as $dummy => $configKey) {
                        // Now unset this configuration entry (to save some memory)
-                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+                       FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry($configKey);
                } // END - foreach
 
                // "Walk" throught the config-copy array again
                foreach ($this->configCopy as $configKey => $dummy) {
                        // Now unset this configuration entry (to save some memory again)
-                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+                       FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry($configKey);
                } // END - foreach
 
                // Remove temporary "special" values as well
-               $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
-               $this->getConfigInstance()->unsetConfigEntry('dht_nodes');
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry('dht_nodes');
        }
 
 }
index 9c08b8c5aa6c84caae0284a32d5df181f3940a98..45f89edea98d6718040a974c8ee8e5c6d1479b68 100644 (file)
@@ -14,6 +14,7 @@ use Org\Shipsimu\Hub\Node\BaseHubNode;
 use Org\Shipsimu\Hub\Template\Engine\Xml\Request\NodeList\XmlRequestNodeListTemplateEngine;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -146,7 +147,7 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                        /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REQUEST-HANDLER: Copying from sourceKey=' . $sourceKey . ' to targetKey=' . $targetKey . '...');
 
                        // Copy from source to targetKey
-                       $this->getConfigInstance()->setConfigEntry($targetKey, $this->getConfigInstance()->getConfigEntry($sourceKey));
+                       FrameworkBootstrap::getConfigurationInstance()->setConfigEntry($targetKey, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($sourceKey));
                } // END - foreach
 
                // Query local DHT for nodes except given session id
@@ -162,13 +163,13 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REQUEST-HANDLER: Got a node list of ' . count($nodeList) . ' entry/-ies back.');
 
                // Set it serialized in configuration (temporarily)
-               $this->getConfigInstance()->setConfigEntry('node_list', base64_encode(json_encode($nodeList)));
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('node_list', base64_encode(json_encode($nodeList)));
 
                // Translate last exception into a status code
                $statusCode = $this->getTranslatedStatusFromLastException();
 
                // Set it in configuration (temporarily)
-               $this->getConfigInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS, $statusCode);
        }
 
        /**
@@ -182,12 +183,12 @@ class NodeMessageRequestNodeListHandler extends BaseMessageHandler implements Ha
                // "Walk" throught the config-copy array again
                foreach ($this->configCopy as $configKey => $dummy) {
                        // Now unset this configuration entry (to save some memory again)
-                       $this->getConfigInstance()->unsetConfigEntry($configKey);
+                       FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry($configKey);
                } // END - foreach
 
                // Remove answer status/node list as well
-               $this->getConfigInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
-               $this->getConfigInstance()->unsetConfigEntry('node_list');
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry(NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_ANSWER_STATUS);
+               FrameworkBootstrap::getConfigurationInstance()->unsetConfigEntry('node_list');
        }
 
 }
index f31006a58b41a5fc49d22916298419a3ab187ef6..03f258e39333c06d589edc5c4a22ba4461e29d8c 100644 (file)
@@ -15,6 +15,7 @@ use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
 use Org\Shipsimu\Hub\Network\Package\Delivery\Fragment\Fragmentable;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -351,7 +352,7 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit
 
                // Calculate buffer size
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: rawData()=%d - after loop ...', strlen($rawData)));
-               $bufferSize = $this->getConfigInstance()->getConfigEntry($this->getProtocolName() . '_buffer_length');
+               $bufferSize = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getProtocolName() . '_buffer_length');
 
                // Encode the raw data with our output-stream
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: bufferSize=%d', $bufferSize));
index 09b2537481d6433f393ff70d10fc7eaf9728efc9..1c39b7fb51b034c3bb23bf27913cd055c08fb42b 100644 (file)
@@ -7,6 +7,9 @@ use Org\Shipsimu\Hub\Factory\State\Peer\PeerStateFactory;
 use Org\Shipsimu\Hub\Helper\Connection\BaseConnectionHelper;
 use Org\Shipsimu\Hub\Locator\Node\LocateableNode;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
 /**
  * A ??? connection helper class
  *
@@ -62,7 +65,7 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper {
                assert($this->isInitialized());
 
                // "Cache" socket resource and timeout config
-               $timeout = $this->getConfigInstance()->getConfigEntry('socket_timeout_seconds');
+               $timeout = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('socket_timeout_seconds');
 
                // Debug output
                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: Trying to connect to %s with socketResource[%s]=%s ...', $this->getSocketInstance()->getSocketRecipient(), gettype($this->getSocketInstance()->getSocketResource()), $this->getSocketInstance()->getSocketResource()));
index 27d8b751b30d87652f767d2e688993906d3b8221..6d005b2894b96e36a868ded8da26cabc59ac5524 100644 (file)
@@ -13,6 +13,7 @@ use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
 use Org\Shipsimu\Hub\Tools\HubTools;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 
 /**
  * A TCP connection helper class
@@ -87,7 +88,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Failed to resolve ' . $packageInstance->getRecipientUnl() . ':' . $e->getMessage());
 
                        // Is the recipient equal as configured UNL?
-                       if (substr($packageInstance->getRecipientUnl(), 0, strlen($helperInstance->getConfigInstance()->getConfigEntry('external_address'))) == $helperInstance->getConfigInstance()->getConfigEntry('external_address')) {
+                       if (substr($packageInstance->getRecipientUnl(), 0, strlen(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('external_address'))) == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('external_address')) {
                                // This may connect to shipsimu.org and requests 'ip.php' which will return our external IP address
                                $unlAddress = HubTools::determineExternalAddress();
 
@@ -115,7 +116,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection
                                        __METHOD__,
                                        __LINE__,
                                        $packageInstance->getRecipientUnl(),
-                                       $helperInstance->getConfigInstance()->getConfigEntry('external_address')
+                                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('external_address')
                                ));
                        }
                }
index 851d2098b2d4686c5cf2b756f94e65906975afdf..1410062d80547374433ea2494d72cc375f9905cf 100644 (file)
@@ -196,7 +196,7 @@ class ConnectionInfo extends BaseInfo implements ShareableInfo, Registerable {
         */
        public function fillWithConnectionHelperInformation (ConnectionHelper $helperInstance) {
                // Fill the generic array with several data from the listener:
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO: protocolName=%s,helperInstance=%s,socketResource=%s - CALLED!', $helperInstance->getProtocolName(), $helperInstance->__toString(), $helperInstance->getSocketResource()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO: protocolName=%s,helperInstance=%s - CALLED!', $helperInstance->getProtocolName(), $helperInstance->__toString()));
                $this->setProtocolName($helperInstance->getSocketInstance()->getSocketProtocol());
                $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_ADDRESS, $helperInstance->getSocketInstance()->getSocketRecipientAddress());
                $this->setGenericArrayElement('connection', 'dummy', 'dummy', LocateableNode::UNL_PART_PORT   , $helperInstance->getSocketInstance()->getSocketRecipientPort());
index d5a7099032fc9b2811febb67624c31b547314e7e..26efe5d2d6e6468e0aee3d5d8483c876fb1a0363 100644 (file)
@@ -3,6 +3,7 @@
 namespace Org\Shipsimu\Hub\Iterator\Producer\Key\TestUnit;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
 use Org\Mxchange\CoreFramework\Iterator\BaseIterator;
 
@@ -57,7 +58,7 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
                parent::__construct(__CLASS__);
 
                // Get key length
-               $this->keyLength = $this->getConfigInstance()->getConfigEntry('test_unit_random_secret_key_length');
+               $this->keyLength = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('test_unit_random_secret_key_length');
 
                // Make sure the key length isn't getting to big (32 byte = 256 bit is really, really a lot!)
                assert($this->keyLength <= (8 * 32));
@@ -141,7 +142,5 @@ class TestUnitKeyProducerIterator extends BaseIterator implements Iterator {
        public function valid () {
                return ($this->currentIteration <= $this->maxBits);
        }
-}
 
-// [EOF]
-?>
+}
index 3134a9661ca5e1d20c8be88c08b1a24dd460f672..d4131f38fe3e23a1b678b23d93f0fd925a10c992 100644 (file)
@@ -16,9 +16,11 @@ use Org\Shipsimu\Hub\Pool\Peer\PoolablePeer;
 use Org\Shipsimu\Hub\Pool\Poolable;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
+use Org\Mxchange\CoreFramework\Registry\Register;
 use Org\Mxchange\CoreFramework\Socket\InvalidServerSocketException;
 use Org\Mxchange\CoreFramework\Socket\SocketAlreadyRegisteredException;
 use Org\Mxchange\CoreFramework\Visitor\Visitable;
@@ -81,6 +83,11 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         */
        private $protocolName = 'invalid';
 
+       /**
+        * Registry instance (implementing Register)
+        */
+       private $registryInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -158,7 +165,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         * @return      void
         */
        public final function setListenAddressByConfiguration (string $configEntry) {
-               $this->setListenAddress($this->getConfigInstance()->getConfigEntry($configEntry));
+               $this->setListenAddress(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry));
        }
 
        /**
@@ -168,7 +175,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
         * @return      void
         */
        public final function setListenPortByConfiguration (string $configEntry) {
-               $this->setListenPort($this->getConfigInstance()->getConfigEntry($configEntry));
+               $this->setListenPort(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry));
        }
 
        /**
@@ -209,6 +216,25 @@ abstract class BaseListener extends BaseHubSystem implements Visitable {
                $this->protocolName = $protocolName;
        }
 
+       /**
+        * Setter for registry instance
+        *
+        * @param       $registryInstance               An instance of a Register class
+        * @return      void
+        */
+       protected final function setRegistryInstance (Register $registryInstance) {
+               $this->registryInstance = $registryInstance;
+       }
+
+       /**
+        * Getter for registry instance
+        *
+        * @return      $registryInstance       The debug registry instance
+        */
+       protected final function getRegistryInstance () {
+               return $this->registryInstance;
+       }
+
        /**
         * Registeres the given socket resource for "this" listener instance. This
         * will be done in a seperate class to allow package writers to use it
index 51dceb09f4e92ddc3a96cbf10c665f887e8d2d1a..79316bddd0890de68954ebd42274d78e42ea7652 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Miner;
 use Org\Shipsimu\Hub\Helper\Miner\MinerHelper;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Controller\Controller;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -73,7 +74,7 @@ class HubCoinMiner extends BaseHubMiner implements MinerHelper, Registerable {
         */
        protected function fillInBufferQueueWithTestUnits () {
                // Are test units enabled?
-               if ($this->getConfigInstance()->getConfigEntry('miner_test_units_enabled') == 'N') {
+               if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('miner_test_units_enabled') == 'N') {
                        // They are disabled, so skip any further steps
                        return;
                } elseif ($this->getStateInstance()->isMinerStateVirgin()) {
@@ -85,7 +86,7 @@ class HubCoinMiner extends BaseHubMiner implements MinerHelper, Registerable {
                $generatorInstance = ObjectFactory::createObjectByConfiguredName('miner_test_unit_generator_class');
 
                // We don't need an iterator here because we just need to generate some test units
-               for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('miner_max_text_unit_amount'); $idx++) {
+               for ($idx = 0; $idx < FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('miner_max_text_unit_amount'); $idx++) {
                        // Get a test unit from it
                        $unitInstance = $generatorInstance->generateNextUnitInstance();
 
index 3215bde1ed84847e4c4332205e9b8634a9679743..c0a72a836cadac4b87397a3db52122a6b68cfa00 100644 (file)
@@ -9,6 +9,7 @@ use Org\Shipsimu\Hub\Helper\Miner\MinerHelper;
 use Org\Shipsimu\Hub\Producer\Block\BlockProducer;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Database\Updateable;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
@@ -125,7 +126,7 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable {
         */
        protected function isInBufferQueueFilled () {
                // Determine it
-               $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > $this->getConfigInstance()->getConfigEntry('miner_in_buffer_min_threshold'));
+               $isFilled = ($this->bufferInstance->getStackCount(self::STACKER_NAME_IN_QUEUE) > FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('miner_in_buffer_min_threshold'));
 
                // And return the result
                return $isFilled;
@@ -210,7 +211,7 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable {
                        $this->fillInBufferQueueWithWorkUnits();
 
                        // Is the buffer still not filled and are test-packages allowed?
-                       if ((!$this->isInBufferQueueFilled()) && ($this->getConfigInstance()->getConfigEntry('miner_test_units_enabled') == 'Y')) {
+                       if ((!$this->isInBufferQueueFilled()) && (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('miner_test_units_enabled') == 'Y')) {
                                // Then fill the in-buffer with (one) test-unit(s)
                                $this->fillInBufferQueueWithTestUnits();
                        } // END - if
index d54b5ac1499762f124a003f0eb519ed758fe7ed2..78a3f6db2b78b37ebc36491379f163a831c97628 100644 (file)
@@ -78,7 +78,7 @@ class HubBootNode extends BaseHubNode implements Node, Registerable {
                // Now check if the IP address matches one of the bootstrap nodes
                if ($this->ifAddressMatchesBootstrapNodes($unl)) {
                        // Get our port from configuration
-                       $ourPort = $this->getConfigInstance()->getConfigEntry('node_listen_port');
+                       $ourPort = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_listen_port');
 
                        // Extract port
                        $bootPort = substr($this->getBootUniversalNodeLocator(), -strlen($ourPort), strlen($ourPort));
index 2791199c7025cd87aec3a3f234a2525c40d9b886..dbb1adb9fb7913a0cca9b0809b7def90768e33a9 100644 (file)
@@ -204,7 +204,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                $isFound = FALSE;
 
                // Run through all configured IPs
-               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unl) {
+               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unl) {
                        // Does it match?
                        if ($unl == $remoteAddr) {
                                // Found it!
@@ -218,7 +218,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
 
                                // Stop further searching
                                break;
-                       } elseif ($unl == $this->getConfigInstance()->getConfigEntry('node_listen_addr')) {
+                       } elseif ($unl == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_listen_addr')) {
                                /*
                                 * IP matches listen address. At this point we really don't care
                                 * if we can really listen on that address
@@ -258,7 +258,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
                        } // END - if
 
                        // There are 2 UNLs, internal and external.
-                       if ($this->getConfigInstance()->getConfigEntry('allow_publish_internal_address') == 'N') {
+                       if (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('allow_publish_internal_address') == 'N') {
                                // Public "external" UNL address
                                $GLOBALS[__METHOD__] = $locatorInstance->getExternalUnl();
                        } else {
@@ -800,7 +800,7 @@ abstract class BaseHubNode extends BaseHubSystem implements Updateable, AddableC
         */
        public function updateNodeData () {
                // Set some dummy configuration entries, e.g. node_status
-               $this->getConfigInstance()->setConfigEntry('node_status', $this->getStateInstance()->getStateName());
+               FrameworkBootstrap::getConfigurationInstance()->setConfigEntry('node_status', $this->getStateInstance()->getStateName());
        }
 
        /**
index ac81171ee5a2f0dd582369741b954659caccf673..5bfde6e7d736cd3600c176aaa0e01e02d11a731c 100644 (file)
@@ -10,6 +10,7 @@ use Org\Shipsimu\Hub\Network\Package\DeliverablePackage;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Assertion\AssertionException;
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -150,7 +151,7 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                // Load some configuration entries and "cache" them:
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: CALLED!');
                // - Chunk size in bits
-               $this->chunkSize = $this->getConfigInstance()->getConfigEntry('package_chunk_size');
+               $this->chunkSize = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_chunk_size');
 
                // - Maximum serial number
                $this->maxSerialNumber = $this->hex2dec(str_repeat('f', self::MAX_SERIAL_LENGTH));
index d39dfba80d3514c6c79aae87d29007a1cdaef8dc..9525ba37df59127b6831c9d9d2bbe972bbfbab06 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Producer;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Stacker\Stackable;
 
@@ -163,7 +164,7 @@ abstract class BaseProducer extends BaseHubSystem {
         * @return      $isReached              Whether the limit is reached
         */
        protected function isOutgoingQueueLimitReached ($configEntry) {
-               return ($this->getConfigInstance()->getConfigEntry($configEntry) <= $this->getOutgoingQueueInstance()->getStackCount(self::STACKER_NAME_OUT_QUEUE));
+               return (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry) <= $this->getOutgoingQueueInstance()->getStackCount(self::STACKER_NAME_OUT_QUEUE));
        }
 
        /**
@@ -192,7 +193,7 @@ abstract class BaseProducer extends BaseHubSystem {
         * @return      $isReached              Whether the limit is reached
         */
        protected function isIncomingQueueLimitReached($configEntry) {
-               return ($this->getConfigInstance()->getConfigEntry($configEntry) <= $this->getIncomingQueueInstance()->getStackCount(self::STACKER_NAME_IN_QUEUE));
+               return (FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry) <= $this->getIncomingQueueInstance()->getStackCount(self::STACKER_NAME_IN_QUEUE));
        }
 
 }
index b82569b43908e2b55c6ce56e2329f4eb9f1aa622..7a745b36e93ebbeb82a77ca70bfee17c984f0c09 100644 (file)
@@ -10,6 +10,7 @@ use Org\Shipsimu\Hub\Network\Recipient\Recipient;
 use Org\Shipsimu\Hub\Tools\HubTools;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Lists\Listable;
 
 /**
@@ -79,7 +80,7 @@ class DirectRecipient extends BaseRecipient implements Recipient {
                $recipients = explode(NetworkPackageHandler::PACKAGE_RECIPIENT_SEPARATOR, $recipientUnl);
 
                // Is maximum reached?
-               assert(count($recipients) <= $this->getConfigInstance()->getConfigEntry('package_recipient_max_count'));
+               assert(count($recipients) <= FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_recipient_max_count'));
 
                // Try it on all
                foreach ($recipients as $recipient) {
index ade3da627b3e743b08c9a889ca4fbf0aa2c1a729..38da98e9507c81ca66be49a0aa7b9d0d530da0cc 100644 (file)
@@ -10,6 +10,7 @@ use Org\Shipsimu\Hub\Network\Recipient\BaseRecipient;
 use Org\Shipsimu\Hub\Network\Recipient\Recipient;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Lists\Listable;
 
 /**
@@ -79,11 +80,11 @@ class UpperRecipient extends BaseRecipient implements Recipient {
                assert($recipientUnl == NetworkPackageHandler::RECIPIENT_TYPE_UPPER);
 
                // Get all bootstrap nodes
-               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unlData) {
+               foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('hub_bootstrap_nodes')) as $unlData) {
                        // Is maximum reached?
-                       if ($listInstance->count() == $this->getConfigInstance()->getConfigEntry('package_recipient_max_count')) {
+                       if ($listInstance->count() == FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_recipient_max_count')) {
                                // Then stop adding more
-                               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UPPER-RECIPIENT: Going to abort at maximum of ' . $this->getConfigInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!');
+                               /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UPPER-RECIPIENT: Going to abort at maximum of ' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('package_recipient_max_count') . ' recipients!');
                                break;
                        } // END - if
 
index 27f7d38e4df45dabe225da8f0829964f82240df1..3fa7c06893aba4777d3aef852ca43b5156db213b 100644 (file)
@@ -7,6 +7,9 @@ use Org\Mxchange\Hub\Node\Node;
 use Org\Mxchange\Hub\Resolver\Protocol\BaseProtocolResolver;
 use Org\Mxchange\Hub\Resolver\Protocol\ProtocolResolver;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
 /**
  * A !!! protocol resolver class
  *
@@ -76,7 +79,7 @@ class !!!ProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
                // Put all together
                $unl = sprintf('%s://%s',
                        $this->getProtocolName(),
-                       $this->getConfigInstance()->getConfigEntry($configKey . '_address')
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey . '_address')
                );
 
                /*
@@ -86,7 +89,5 @@ class !!!ProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
                 */
                return $unl;
        }
-}
 
-// [EOF]
-?>
+}
index 3c69aef0f170d1da441ccd15a9bd696b27427fc2..705da89215e450f54dbe4f417c4bf7118693eec3 100644 (file)
@@ -10,6 +10,7 @@ use Org\Shipsimu\Hub\Resolver\Protocol\BaseProtocolResolver;
 use Org\Shipsimu\Hub\Resolver\Protocol\ProtocolResolver;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Console\Tools\ConsoleTools;
 use Org\Mxchange\CoreFramework\Criteria\Search\SearchCriteria;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
@@ -112,7 +113,7 @@ class TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
         */
        public function resolveUniversalNodeLocatorFromConfigKey ($configKey) {
                // Get address
-               $address = $this->getConfigInstance()->getConfigEntry($configKey . '_address');
+               $address = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configKey . '_address');
 
                // Is the address empty?
                if (empty($address)) {
@@ -132,7 +133,7 @@ class TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolv
                $unl = sprintf('%s://%s:%s',
                        $this->getProtocolName(),
                        $address,
-                       $this->getConfigInstance()->getConfigEntry('node_listen_port')
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_listen_port')
                );
 
                /*
index 5a16e714ebd94ff11b9b411bae3048f2c605a1db..93f716eceb05e22b7a8add723326c5f5b7dff490 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Crawler\Source\Unit;
 use Org\Shipsimu\Hub\Crawler\Source\BaseSource;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 
@@ -70,10 +71,10 @@ class TestUnitSource extends BaseSource implements UnitSource, Registerable {
         */
        public function generateMessageFromSource () {
                // Get a very secret message by encoding and random string with BASE64
-               $secretMessage = base64_encode($this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_message_length')));
+               $secretMessage = base64_encode($this->getRngInstance()->randomString(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('random_secret_message_length')));
 
                // Get a random, secret key
-               $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('test_unit_random_secret_key_length') / 8);
+               $secretKey = $this->getRngInstance()->randomString(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('test_unit_random_secret_key_length') / 8);
 
                // Now encrypt the message with our key and a good (strong) cipher
                $encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));
index 0f23b5ed1461c8980a94c396ee4b73419e8203b6..764288f4d2a931d7f9265984f63f1593fb97f71e 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Crawler\Source\Url\BaseUrlSource;
 use Org\Shipsimu\Hub\Crawler\Source\Url\UrlSource;
 
 // Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Generic\NullPointerException;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
@@ -92,7 +93,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                parent::__construct(__CLASS__);
 
                // "Cache" CSV path for faster usage
-               $this->csvFilePath = $this->getConfigInstance()->getConfigEntry('root_base_path') . $this->getConfigInstance()->getConfigEntry('crawler_csv_file_path');
+               $this->csvFilePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('root_base_path') . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crawler_csv_file_path');
 
                // Initialize directory instance
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CRAWLER-UPLOADED-LIST-URL-SOURCE: this->csvFilePath=%s', $this->csvFilePath));
@@ -115,7 +116,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
                }
 
                // "Cache" column separator
-               $this->columnSeparator = $this->getConfigInstance()->getConfigEntry('crawler_url_list_column_separator');
+               $this->columnSeparator = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('crawler_url_list_column_separator');
 
                // Trace message
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CRAWLER-UPLOADED-LIST-URL-SOURCE: Finished contructing object.');
index 46e0b05d950b5f49b5b0f27841e8ac359613bee3..fa48628e1324b92be1c18124f1a71bf18606bfee 100644 (file)
@@ -6,6 +6,9 @@ namespace Org\Shipsimu\Hub\Helper\Connection;
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 use Org\Shipsimu\Hub\Helper\Connection\ConnectionHelper;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+
 /**
  * A helper class for maintaining connection statistics, no instance is
  * required to use this class.
@@ -74,7 +77,7 @@ class ConnectionStatisticsHelper extends BaseHubSystem {
                        (
                                isset(self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'])
                        ) && (
-                               self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'] >= $helperInstance->getConfigInstance()->getConfigEntry($configEntry)
+                               self::$connectionStatistics[$helperInstance->getProtocolName()][$helperInstance->__toString()]['retry_count'] >= FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($configEntry)
                        )
                );
 
index 1a6c627edd7bbe5d76e55cfc71fd814e8967993e..06c7715a3821ec006ca9ede7cbd8e6f224f78014 100644 (file)
@@ -104,7 +104,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
                $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
 
                // Determine base path
-               $templateBasePath = $this->getConfigInstance()->getConfigEntry('application_base_path') . FrameworkBootstrap::getRequestInstance()->getRequestElement('app') . '/';
+               $templateBasePath = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('application_base_path') . FrameworkBootstrap::getRequestInstance()->getRequestElement('app') . '/';
 
                // Is the base path valid?
                if (empty($templateBasePath)) {
@@ -125,13 +125,13 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
                $this->setTemplateBasePath($templateBasePath);
 
                // Set template extensions
-               $this->setRawTemplateExtension($this->getConfigInstance()->getConfigEntry('raw_template_extension'));
-               $this->setCodeTemplateExtension($this->getConfigInstance()->getConfigEntry($typePrefix . '_message_template_extension'));
+               $this->setRawTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('raw_template_extension'));
+               $this->setCodeTemplateExtension(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($typePrefix . '_message_template_extension'));
 
                // Absolute output path for compiled templates
                $this->setCompileOutputPath(sprintf('%s%s',
                        $templateBasePath,
-                       $this->getConfigInstance()->getConfigEntry('compile_output_path')
+                       FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('compile_output_path')
                ));
 
                // Init a variable stacker
@@ -164,7 +164,7 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
                } // END - if
 
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry($templateName));
+               $this->setTemplateType(FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($templateName));
 
                // Load the special template
                $this->loadTemplate($this->xmlTemplateType);
index 8f48342b9448bb418e17082614d907a678daf0ea..0e0f711100ee1b912f9ea516ffba066e38bb88e9 100644 (file)
@@ -69,7 +69,7 @@ class HubTools extends BaseHubSystem {
                parent::__construct(__CLASS__);
 
                // Init salt length
-               $this->sessionIdLength = 32 + $this->getConfigInstance()->getConfigEntry('salt_length');
+               $this->sessionIdLength = 32 + FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('salt_length');
        }
 
        /**
@@ -132,7 +132,7 @@ class HubTools extends BaseHubSystem {
                        // Is the session id the same?
                        if ($nodeInstance->getSessionId() == $sessionId) {
                                // Then get an instance of a LocateableNode class from it, assume TCP by default
-                               $recipientUnl = self::determineOwnExternalAddress() . ':' . $nodeInstance->getConfigInstance()->getConfigEntry('node_listen_port');
+                               $recipientUnl = self::determineOwnExternalAddress() . ':' . FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('node_listen_port');
                        } // END - if
                }
 
diff --git a/core b/core
index c1aadb61b45c15273c07c366887c8f58c53155e3..9128348f96854b318a9bf8884b1ee035f3f94e6c 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit c1aadb61b45c15273c07c366887c8f58c53155e3
+Subproject commit 9128348f96854b318a9bf8884b1ee035f3f94e6c