]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 22 Nov 2020 16:38:22 +0000 (17:38 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Nov 2020 16:38:22 +0000 (17:38 +0100)
- added missing $templateInstance and getter/setter
- converted old array() to "new" [] style
- added missing config entries
- updated core framework

Signed-off-by: Roland Häder <roland@mxchange.org>
31 files changed:
application/hub/class_ApplicationHelper.php
application/hub/classes/commands/console/class_HubConsoleAptProxyCommand.php
application/hub/classes/commands/console/class_HubConsoleChatCommand.php
application/hub/classes/commands/console/class_HubConsoleCrawlerCommand.php
application/hub/classes/commands/console/class_HubConsoleCruncherCommand.php
application/hub/classes/commands/console/class_HubConsoleMainCommand.php
application/hub/classes/commands/console/class_HubConsoleMinerCommand.php
application/hub/classes/container/socket/class_SocketContainer.php
application/hub/classes/dht/node/class_NodeDhtFacade.php
application/hub/classes/factories/info/class_ConnectionInfoFactory.php
application/hub/classes/filter/class_BaseHubFilter.php
application/hub/classes/handler/chunks/class_ChunkHandler.php
application/hub/classes/handler/data/class_BaseDataHandler.php
application/hub/classes/helper/class_BaseHubSystemHelper.php
application/hub/classes/helper/connection/class_BaseConnectionHelper.php
application/hub/classes/locator/class_UniversalNodeLocator.php
application/hub/classes/miner/class_BaseHubMiner.php
application/hub/classes/package/assembler/class_PackageAssembler.php
application/hub/classes/package/deliverable/class_PackageData.php
application/hub/classes/package/fragmenter/class_PackageFragmenter.php
application/hub/classes/pools/peer/class_DefaultPeerPool.php
application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php
application/hub/classes/resolver/controller/console/class_HubConsoleControllerResolver.php
application/hub/classes/resolver/controller/html/class_HubHtmlControllerResolver.php
application/hub/classes/source/urls/class_CrawlerUploadedListUrlSource.php
application/hub/classes/states/miner/booting/class_MinerBootingState.php
application/hub/classes/tags/class_BaseTag.php
application/hub/classes/template/class_BaseXmlTemplateEngine.php
application/hub/classes/tools/hub/class_HubTools.php
application/hub/config.php
core

index 0a430c832a323390ee54bdad673c0fac3b9c87b4..ea51d451e374612763c716ef00e8206fe810e307 100644 (file)
@@ -148,16 +148,17 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                        $this->setLanguageInstance($languageInstance);
                } // END - if
 
-               // Get a controller resolver
-               $resolverClass = sprintf(
-                       'Org\Shipsimu\Hub\Resolver\Controller\%s',
-                       StringUtils::convertToClassName(sprintf(
-                               '%s_%s_controller_resolver',
-                               $this->getAppShortName(),
-                               FrameworkBootstrap::getRequestTypeFromSystem()
-                       ))
+               // Configuration entry key
+               $configEntry = sprintf(
+                       '%s_%s_controller_resolver_class',
+                       $this->getAppShortName(),
+                       FrameworkBootstrap::getRequestTypeFromSystem()
                );
-               $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
+
+               // Get a controller resolver instance
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName($configEntry, [
+                       $commandName,
+               ]);
 
                // Get a controller instance as well
                $this->setControllerInstance($resolverInstance->resolveController());
index b3e5a18d8f522c1a30df48e07dfef4eac5f7adb8..bc40a927330865df2308f5a11f9c65dca6863ba5 100644 (file)
@@ -138,7 +138,5 @@ class HubConsoleAptProxyCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('apt_proxy_shutdown_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index fb95de6d0b552b63ef89a014e4347f33c519cb0b..044b3abca3c509e0ef1979582bc459d5d29ea8f7 100644 (file)
@@ -138,7 +138,5 @@ class HubConsoleChatCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index 149dd30163686323da04cec294c500e6db647170..2eb9830b645d9ae9579e1325e9d15119313df497 100644 (file)
@@ -138,7 +138,5 @@ class HubConsoleCrawlerCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('crawler_shutdown_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index 7cacaaae1c3c2c67b0a4c12a8b552afb464fdb08..0f16239093f4db361d1a03c58d6862c0e46d09df 100644 (file)
@@ -139,7 +139,5 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index 6923cb7ea50415ec0e57d23501415f1b51702e22..092eeaba7e415e4872cefcc5f185ef10baa1a082 100644 (file)
@@ -153,7 +153,5 @@ class HubConsoleMainCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('node_shutdown_node_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index 5fdce95c8f903fde6d9703a8e114f24f70b3ff40..ba86d25d245c3be6cd034a4209903f0aad793340 100644 (file)
@@ -139,7 +139,5 @@ class HubConsoleMinerCommand extends BaseCommand implements Commandable {
                // This is the last generic shutdown filter
                $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('miner_shutdown_filter_class'));
        }
-}
 
-// [EOF]
-?>
+}
index f3f403b031929ba5a2228bfac266399a0ea92feb..283258f01b0dd828b3f7e143d7a3cca6293df735 100644 (file)
@@ -68,7 +68,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
        /**
         * An array with all valid connection types
         */
-       private $connectionTypes = array();
+       private $connectionTypes = [];
 
        /**
         * Timeout in usec for socket_select()
@@ -737,9 +737,9 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita
 
                // Init all arrays, at least readers
                /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s', strtoupper($this->getSocketProtocol()), $this->getSocketResource()));
-               $readers = array($this->getSocketResource());
-               $writers = array();
-               $excepts = array();
+               $readers = [$this->getSocketResource()];
+               $writers = [];
+               $excepts = [];
 
                // Check if we have some peers left
                /* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: Calling socket_select(%d,%d,%d,0%d) ...', strtoupper($this->getSocketProtocol()), count($readers), count($writers), count($excepts), $this->socketSelectTimeout));
index 9ccb7920eaa37a850966a72c81a506cd27d720fc..97a635f7e67d24b9caf61b8d1a1e36809a3d2d1c 100644 (file)
@@ -174,7 +174,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                }
 
                // Default is empty data array
-               $nodeData = array();
+               $nodeData = [];
 
                /*
                 * Call the wrapper to do the job and get back a result instance. There
@@ -210,7 +210,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                // Default is empty data array
                /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: locatorInstance=%s - CALLED!', $locatorInstance->__toString()));
                //* DEBUG-DIE: */ die(sprintf('[%s:%d]: locatorInstance=%s', __METHOD__, __LINE__, print_r($locatorInstance, TRUE)));
-               $nodeData = array();
+               $nodeData = [];
 
                // Query database
                $resultInstance = $this->getWrapperInstance()->findNodeLocalByLocatorInstance($locatorInstance);
@@ -333,7 +333,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                assert($resultInstance->valid());
 
                // Init array
-               $nodeList = array();
+               $nodeList = [];
 
                // Get node list
                while ($resultInstance->next()) {
@@ -407,7 +407,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                } // END - if
 
                // Init array
-               $recipients = array();
+               $recipients = [];
 
                // Search for all recipients
                while ($resultInstance->next()) {
@@ -447,7 +447,7 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
                assert($resultInstance->valid());
 
                // Init array
-               $recipients = array();
+               $recipients = [];
 
                // "Walk" through all entries
                while ($resultInstance->next()) {
index 719459c2e5032f9624f57666b97f092ec86db44a..0c6d0100118e8dd4414fd908ee9a6cf67e7c39c3 100644 (file)
@@ -38,7 +38,7 @@ class ConnectionInfoFactory extends ObjectFactory {
        /**
         * Array with all valid types
         */
-       private static $validTypes = array();
+       private static $validTypes = [];
 
        /**
         * Protected constructor
index cd740b93f7dc4342ca116d53c065ae2a85f32030..a0252091c9d28685f2995b9437e9b3a699f35c2c 100644 (file)
@@ -37,7 +37,7 @@ abstract class BaseHubFilter extends BaseFilter {
        /**
         * Array with all data XML nodes (which hold the actual data) and their values
         */
-       protected $dataXmlNodes = array();
+       protected $dataXmlNodes = [];
 
        /**
         * Protected constructor
index f27d4ed55866d4335713d20ab4ab61197a3f7dda..05eed6ee3fe011a587372e017c89f58ad51f53ee 100644 (file)
@@ -58,12 +58,12 @@ class ChunkHandler extends BaseHubHandler implements HandleableChunks, Registera
        /**
         * The final array for assembling the original package back together
         */
-       private $finalPackageChunks = array();
+       private $finalPackageChunks = [];
 
        /**
         * Array of chunk hashes
         */
-       private $chunkHashes = array();
+       private $chunkHashes = [];
 
        /**
         * Raw EOP chunk data in an array:
@@ -71,7 +71,7 @@ class ChunkHandler extends BaseHubHandler implements HandleableChunks, Registera
         * 0 = Final hash,
         * 1 = Hash of last chunk
         */
-       private $eopChunk = array();
+       private $eopChunk = [];
 
        /**
         * An instance of raw package data
@@ -161,7 +161,7 @@ class ChunkHandler extends BaseHubHandler implements HandleableChunks, Registera
                );
 
                // ... chunkHashes:
-               $this->chunkHashes = array();
+               $this->chunkHashes = [];
 
                // ... eopChunk:
                $this->eopChunk = array(
index a1fa1c00104d99ad7f2a39a359a0848e0ebc9417..c452b7425fc71b48aa15f557019b1d3f33f107fe 100644 (file)
@@ -44,23 +44,23 @@ abstract class BaseDataHandler extends BaseHubHandler implements HubInterface {
        /**
         * Array with search criteria elements
         */
-       protected $searchData = array();
+       protected $searchData = [];
 
        /**
         * Array with all data XML nodes (which hold the actual data) and their values
         */
-       protected $messageDataElements = array();
+       protected $messageDataElements = [];
 
        /**
         * Array for translating message data elements (other node's data mostly)
         * into configuration elements.
         */
-       protected $messageToConfig = array();
+       protected $messageToConfig = [];
 
        /**
         * Array for copying configuration entries
         */
-       protected $configCopy = array();
+       protected $configCopy = [];
 
        /**
         * Protected constructor
index a4d96251f16c579ef498b34fa70d014209282303..959863a61d70effdce28b9f05a37b4f0042038f0 100644 (file)
@@ -5,6 +5,9 @@ namespace Org\Shipsimu\Hub\Helper;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
+
 /**
  * A general hub helper class. This class does not extend BaseHelper.
  *
@@ -41,7 +44,12 @@ class BaseHubSystemHelper extends BaseHubSystem implements HubHelper {
        /**
         * Package tags
         */
-       private $packageTags = array();
+       private $packageTags = [];
+
+       /**
+        * Template engine instance
+        */
+       private $templateInstance = NULL;
 
        /**
         * Protected constructor
@@ -109,6 +117,25 @@ class BaseHubSystemHelper extends BaseHubSystem implements HubHelper {
                $this->packageTags = $packageTags;
        }
 
+       /**
+        * Setter for template engine instances
+        *
+        * @param       $templateInstance       An instance of a template engine class
+        * @return      void
+        */
+       protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+               $this->templateInstance = $templateInstance;
+       }
+
+       /**
+        * Getter for template engine instances
+        *
+        * @return      $templateInstance       An instance of a template engine class
+        */
+       public final function getTemplateInstance () {
+               return $this->templateInstance;
+       }
+
        /**
         * Tries to determine the used protocol for this package (this helper is helping to send out)
         *
index 03f258e39333c06d589edc5c4a22ba4461e29d8c..6dcb5c86c83821be12cdcd915aee803e294eb72a 100644 (file)
@@ -67,7 +67,7 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit
        /**
         * Currently queued chunks
         */
-       private $queuedChunks = array();
+       private $queuedChunks = [];
 
        /**
         * Current final hash
index 8d89393b57963d71e81674a2026813cfe3c8b8c3..bb0d31b4fa944cbd025763e5caba21988e1c5f3f 100644 (file)
@@ -41,7 +41,7 @@ class UniversalNodeLocator extends BaseHubSystem implements LocateableNode, Regi
        /**
         * UNL data array
         */
-       private $unlData = array();
+       private $unlData = [];
 
        /**
         * Protected constructor
@@ -132,7 +132,7 @@ class UniversalNodeLocator extends BaseHubSystem implements LocateableNode, Regi
         */
        private function initUniversalNodeLocator (array $unlData = array()) {
                // Init UNL array
-               $this->unlData = array();
+               $this->unlData = [];
 
                // Copy all found entries
                foreach (array(
index c0a72a836cadac4b87397a3db52122a6b68cfa00..0fc26141c2f1b3ee05e3f23b3c0db31a69e2e3e3 100644 (file)
@@ -55,7 +55,7 @@ abstract class BaseHubMiner extends BaseHubSystem implements Updateable {
        /**
         * An array for initialized producers
         */
-       private $producersInitialized = array();
+       private $producersInitialized = [];
 
        /**
         * Stacker name for incoming queue
index 34cda4532c4b7ba42edce2b84801ea2765959d13..9ccbac0ee9e6a952136810153dfb7c4753b29ff5 100644 (file)
@@ -67,7 +67,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable,
        /**
         * Private call-back methods
         */
-       private $callbacks = array();
+       private $callbacks = [];
 
        /**
         * A network package handler instance
index 4d0f7c5a1f0c35cc3c3fb3b0e495794a0dfb32af..72e2dce22705ced4284fd329f47db3d404d9dca5 100644 (file)
@@ -457,7 +457,7 @@ class PackageData extends BaseHubSystem implements DeliverablePackage, Registera
                $properties = $reflectionInstance->getProperties(ReflectionProperty::IS_PRIVATE);
 
                // Init array
-               $packageData = array();
+               $packageData = [];
 
                // Loop through all
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('PACKAGE-DATA: properties()=%d', count($properties)));
index 87ca2eb7fa9427011ee567008d411e2ee9f4dc5c..8f3696bf11aa99db261797ffb4ce32cc39664730 100644 (file)
@@ -55,27 +55,27 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
        /**
         * Array for chunks
         */
-       private $chunks = array();
+       private $chunks = [];
 
        /**
         * Array for chunk hashes
         */
-       private $chunkHashes = array();
+       private $chunkHashes = [];
 
        /**
         * Array for chunk pointers
         */
-       private $chunkPointers = array();
+       private $chunkPointers = [];
 
        /**
         * Array for processed packages
         */
-       private $processedPackages = array();
+       private $processedPackages = [];
 
        /**
         * Serial numbers (array key is final hash)
         */
-       private $serialNumber = array();
+       private $serialNumber = [];
 
        /**
         * Maximum possible serial number, "cache" for speeding up things
@@ -135,8 +135,10 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: CALLED!');
                $fragmenterInstance = new PackageFragmenter();
 
-               // Get a crypto instance and set it here
+               // Get a crypto instance
                $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+
+               // Set it here
                $fragmenterInstance->setCryptoInstance($cryptoInstance);
 
                // Return the prepared instance
@@ -430,8 +432,8 @@ class PackageFragmenter extends BaseHubSystem implements Fragmentable, Registera
                        // Is the array there?
                        if (!isset($this->chunks[$finalHash])) {
                                // Then initialize it
-                               $this->chunks[$finalHash]      = array();
-                               $this->chunkHashes[$finalHash] = array();
+                               $this->chunks[$finalHash]      = [];
+                               $this->chunkHashes[$finalHash] = [];
                        } // END - if
 
                        // Add both
index 7f57e148fa86a391aefeb8ed71c250789f6322b3..4b135d1b0c327de1734faad3e4b337bdab925bd2 100644 (file)
@@ -175,7 +175,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                $socketArrays = $this->getArrayFromList('pool');
 
                // Init socket array
-               $sockets = array();
+               $sockets = [];
 
                // "Walk" through all socket arrays
                foreach ($socketArrays as $socketArray) {
@@ -207,7 +207,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
                $socketArrays = $this->getArrayFromList('pool');
 
                // Init socket array
-               $sockets = array();
+               $sockets = [];
 
                // "Walk" through all socket arrays
                foreach ($socketArrays as $socketArray) {
index 542f4e4f29beb463b3ac2aed53045b6ff95e17a5..bc801b509781868f4bf86c9e87bc81d2ac4cea6d 100644 (file)
@@ -5,6 +5,9 @@ namespace Org\Shipsimu\Hub\Producer\Cruncher\Unit;
 // Import application-specific stuff
 use Org\Shipsimu\Hub\Producer\Cruncher\BaseCruncherProducer;
 
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
+
 /**
  * A general UnitProducer class
  *
@@ -41,6 +44,11 @@ abstract class BaseUnitProducer extends BaseCruncherProducer {
        const UNIT_TYPE_TEST_UNIT = 'test_unit';
        const UNIT_TYPE_TEST_WORK = 'work_unit';
 
+       /**
+        * Template engine instance
+        */
+       private $templateInstance = NULL;
+
        /**
         * Protected constructor
         *
@@ -52,4 +60,23 @@ abstract class BaseUnitProducer extends BaseCruncherProducer {
                parent::__construct($className);
        }
 
+       /**
+        * Setter for template engine instances
+        *
+        * @param       $templateInstance       An instance of a template engine class
+        * @return      void
+        */
+       protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+               $this->templateInstance = $templateInstance;
+       }
+
+       /**
+        * Getter for template engine instances
+        *
+        * @return      $templateInstance       An instance of a template engine class
+        */
+       protected final function getTemplateInstance () {
+               return $this->templateInstance;
+       }
+
 }
index 6c80fbcba65cf8ebfedb28ee0f0335316c4de392..b9750b317f361047e08eb05bbce75b22822df7d2 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Shipsimu\Hub\Resolver\Controller;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 
@@ -48,12 +47,11 @@ class HubConsoleControllerResolver extends BaseControllerResolver implements Con
         * Creates an instance of a resolver class with a given command
         *
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      EmptyVariableException          Thrown if default command is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createHubConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createHubConsoleControllerResolver ($controllerName) {
                // Create the new instance
                $resolverInstance = new HubConsoleControllerResolver();
 
index f89514ab9f9f79e8ca87f852068bb5126077ecda..71ad86c5e536480c90cc7b47dfa740e41dabf7f6 100644 (file)
@@ -4,7 +4,6 @@ namespace Org\Shipsimu\Hub\Resolver\Controller;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Controller\Controller;
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
 use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
 use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
 
@@ -48,12 +47,11 @@ class HubHtmlControllerResolver extends BaseControllerResolver implements Contro
         * Creates an instance of a resolver class with a given command
         *
         * @param       $controllerName                         The controller we shall resolve
-        * @param       $applicationInstance            An instance of a manageable application helper class
         * @return      $resolverInstance                       The prepared controller resolver instance
         * @throws      EmptyVariableException          Thrown if default command is not set
         * @throws      InvalidControllerException      Thrown if default controller is invalid
         */
-       public static final function createHubHtmlControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+       public static final function createHubHtmlControllerResolver ($controllerName) {
                // Create the new instance
                $resolverInstance = new HubHtmlControllerResolver();
 
index 2b56d7ab2a53d6b5b9d66bb4b2fa2a51eb1465ab..ba2d141bf0a3d624405f54e7044e8bf393f92a7b 100644 (file)
@@ -76,7 +76,7 @@ class CrawlerUploadedListUrlSource extends BaseUrlSource implements UrlSource, R
        /**
         * "Imported" CSV files
         */
-       private $csvFileImported = array();
+       private $csvFileImported = [];
 
        /**
         * "Cached" separator for columns
index 615d96050b45acb3feba35a819bca84febdf7118..7b3522aa5eada5a55e5ff557bb7db256a8cf88ab 100644 (file)
@@ -32,7 +32,7 @@ class MinerBootingState extends BaseMinerState implements Stateable {
        /**
         * Array of booted producers
         */
-       private $bootedProducer = array();
+       private $bootedProducer = [];
 
        /**
         * Protected constructor
index 0f21e5c91a1c81be7a677bd429e5654f403778bb..82c02929c1defa844352395b6fd12af35c50635b 100644 (file)
@@ -7,6 +7,7 @@ use Org\Shipsimu\Hub\Generic\BaseHubSystem;
 
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 
 /**
  * A general Tags class
@@ -34,7 +35,12 @@ abstract class BaseTag extends BaseHubSystem implements Registerable {
        /**
         * An array with all tags
         */
-       private $tags = array();
+       private $tags = [];
+
+       /**
+        * Template engine instance
+        */
+       private $templateInstance = NULL;
 
        /**
         * Protected constructor
@@ -66,4 +72,23 @@ abstract class BaseTag extends BaseHubSystem implements Registerable {
                return $this->tags;
        }
 
+       /**
+        * Setter for template engine instances
+        *
+        * @param       $templateInstance       An instance of a template engine class
+        * @return      void
+        */
+       protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+               $this->templateInstance = $templateInstance;
+       }
+
+       /**
+        * Getter for template engine instances
+        *
+        * @return      $templateInstance       An instance of a template engine class
+        */
+       protected final function getTemplateInstance () {
+               return $this->templateInstance;
+       }
+
 }
index 3cd57446bc0d7bd8bc0b196e086ba94b942ab6fa..c9e34b3b4cc4fcab1f3e751d02aaa3bcef14aee2 100644 (file)
@@ -7,6 +7,7 @@ use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
 use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
+use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
 use Org\Mxchange\CoreFramework\Template\Engine\BaseTemplateEngine;
 use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
 
@@ -40,17 +41,17 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
        /**
         * Main nodes in the XML tree
         */
-       private $mainNodes = array();
+       private $mainNodes = [];
 
        /**
         * Sub nodes in the XML tree
         */
-       private $subNodes = array();
+       private $subNodes = [];
 
        /**
         * Current main node
         */
-       private $curr = array();
+       private $curr = [];
 
        /**
         * XML template type
@@ -70,7 +71,12 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
        /**
         * Content from dependency
         */
-       protected $dependencyContent = array();
+       protected $dependencyContent = [];
+
+       /**
+        * Template engine instance
+        */
+       private $templateInstance = NULL;
 
        /**
         * Protected constructor
@@ -227,6 +233,25 @@ abstract class BaseXmlTemplateEngine extends BaseTemplateEngine {
                return $this->subNodes;
        }
 
+       /**
+        * Setter for template engine instances
+        *
+        * @param       $templateInstance       An instance of a template engine class
+        * @return      void
+        */
+       protected final function setTemplateInstance (CompileableTemplate $templateInstance) {
+               $this->templateInstance = $templateInstance;
+       }
+
+       /**
+        * Getter for template engine instances
+        *
+        * @return      $templateInstance       An instance of a template engine class
+        */
+       protected final function getTemplateInstance () {
+               return $this->templateInstance;
+       }
+
        /**
         * Read XML variables by calling readVariable() with 'general' as
         * variable stack.
index 0e0f711100ee1b912f9ea516ffba066e38bb88e9..733de785c537473d35ae6145f29cf5a7aa0344bc 100644 (file)
@@ -47,7 +47,7 @@ class HubTools extends BaseHubSystem {
        /**
         * Cache for session ids
         */
-       private $sessionIdCache = array();
+       private $sessionIdCache = [];
 
        /**
         * Length for session id (should be 32+salt_length
index f9ed99a7000ff8ee8964931238cb8d5987fba011..7559cde75a271f216a78efd28bde18f71ed0b82f 100644 (file)
@@ -162,6 +162,12 @@ $cfg->setConfigEntry('default_console_command', 'main');
 // CFG: DEFAULT-HUB-CONSOLE-COMMAND
 $cfg->setConfigEntry('default_hub_console_command', 'main');
 
+// CFG: HUB-CONSOLE-CONTROLLER_RESOLVER-CLASS
+$cfg->setConfigEntry('hub_console_controller_resolver_class', 'Org\Shipsimu\Hub\Resolver\Controller\HubConsoleControllerResolver');
+
+// CFG: HUB-HTML-CONTROLLER_RESOLVER-CLASS
+$cfg->setConfigEntry('hub_html_controller_resolver_class', 'Org\Shipsimu\Hub\Resolver\Controller\HubHtmlControllerResolver');
+
 // CFG: HUB-CONSOLE-CMD-MAIN-RESOLVER-CLASS
 $cfg->setConfigEntry('hub_console_cmd_main_resolver_class', 'Org\Shipsimu\Hub\Resolver\Command\HubConsoleCommandResolver');
 
diff --git a/core b/core
index 690d7f053ed4420a1aff4387be75d8ae75155bdf..df3701b7230349ee2bc711caba98809ac943363c 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit 690d7f053ed4420a1aff4387be75d8ae75155bdf
+Subproject commit df3701b7230349ee2bc711caba98809ac943363c