]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/nodes/boot/class_HubBootNode.php
Rewritten class structure to make it more OOP-friendly (stupid comment, I know)
[hub.git] / application / hub / main / nodes / boot / class_HubBootNode.php
index 0be26c3d3693ec5c82a760b6dd2453b99ed45909..32bb6366dd578839ef4a7f5a442239407235c038 100644 (file)
@@ -45,6 +45,13 @@ class HubBootNode extends BaseHubNode implements NodeHelper {
                // Set the request instance
                $nodeInstance->setRequestInstance($requestInstance);
 
+               // --------------------- Hub-id acquirement phase ---------------------
+               // Acquire a hub-id. This step generates on first launch a new one and
+               // on any later launches it will restore the hub-id from the database.
+               // A passed 'nickname=xxx' argument will be used to add some
+               // 'personality' to the hub.
+               $nodeInstance->acquireHubId();
+
                // Return the instance
                return $nodeInstance;
        }
@@ -58,12 +65,12 @@ class HubBootNode extends BaseHubNode implements NodeHelper {
         * @todo        add some more special bootstrap things for this boot node
         */
        public function doBootstrapping () {
-               // Call generic (parent) bootstrapping method
+               // Call generic (parent) bootstrapping method first
                parent::doGenericBootstrapping();
 
                // Now check if the IP address matches one of the bootstrap nodes
                if ($this->ifAddressMatchesBootstrappingNodes($_SERVER['REMOTE_ADDR'])) {
-                       // Get our port
+                       // Get our port from configuration
                        $ourPort = $this->getConfigInstance()->readConfig('node_listen_port');
 
                        // Is the port the same?
@@ -83,7 +90,10 @@ class HubBootNode extends BaseHubNode implements NodeHelper {
                } // END - if
 
                // This might not be all...
-               $this->partialStub("Please implement more bootsrapping steps.");
+               $this->partialStub('Please implement more bootsrapping steps.');
+
+               // This should be the last thing to do: output teaser lines
+               $this->outputConsoleTeaser();
        }
 }