]> git.mxchange.org Git - hub.git/commitdiff
Renamed path + fixed stacker names + added some missing entries.
authorRoland 'Quix0r' Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 23:37:06 +0000 (00:37 +0100)
committerRoland 'Quix0r' Haeder <roland@mxchange.org>
Fri, 14 Mar 2014 23:37:06 +0000 (00:37 +0100)
Signed-off-by: Roland 'Quix0r' Haeder <roland@mxchange.org>
application/hub/config.php
application/hub/main/template/bootstrap/.htaccess [deleted file]
application/hub/main/template/bootstrap/class_XmlBootstrapTemplateEngine.php [deleted file]
application/hub/main/template/bootstrap/class_XmlDhtBootstrapTemplateEngine.php [deleted file]
application/hub/main/template/dht/.htaccess [new file with mode: 0644]
application/hub/main/template/dht/class_XmlBootstrapTemplateEngine.php [new file with mode: 0644]
application/hub/main/template/dht/class_XmlDhtBootstrapTemplateEngine.php [new file with mode: 0644]
application/hub/main/template/publish/class_XmlDhtPublishEntryTemplateEngine.php

index 2b2a1d92267a07acfe07d8ebb2669d6b29e7da4f..e37f348a00d77ae6bb94c89f4e60b69f47610649 100644 (file)
@@ -288,6 +288,9 @@ $cfg->setConfigEntry('node_announcement_stacker_class', 'FiLoStacker');
 // CFG: NODE-ANNOUNCEMENT-ANSWER-STACKER-CLASS
 $cfg->setConfigEntry('node_announcement_answer_stacker_class', 'FiLoStacker');
 
+// CFG: NODE-DHT-BOOTSTRAP-STACKER-CLASS
+$cfg->setConfigEntry('node_dht_publish_stacker_class', 'FiLoStacker');
+
 // CFG: NODE-DHT-BOOTSTRAP-ANSWER-STACKER-CLASS
 $cfg->setConfigEntry('node_dht_bootstrap_answer_stacker_class', 'FiLoStacker');
 
@@ -384,6 +387,9 @@ $cfg->setConfigEntry('stacker_node_announcement_max_size', 20);
 // CFG: STACKER-NODE-ANNOUNCEMENT-ANSWER-MAX-SIZE
 $cfg->setConfigEntry('stacker_node_announcement_answer_max_size', 20);
 
+// CFG: STACKER-NODE-DHT-BOOTSTRAP-MAX-SIZE
+$cfg->setConfigEntry('stacker_node_dht_bootstrap_max_size', 10);
+
 // CFG: STACKER-NODE-DHT-BOOTSTRAP-ANSWER-MAX-SIZE
 $cfg->setConfigEntry('stacker_node_dht_bootstrap_answer_max_size', 20);
 
diff --git a/application/hub/main/template/bootstrap/.htaccess b/application/hub/main/template/bootstrap/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/hub/main/template/bootstrap/class_XmlBootstrapTemplateEngine.php b/application/hub/main/template/bootstrap/class_XmlBootstrapTemplateEngine.php
deleted file mode 100644 (file)
index f551ef4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-// @DEPRECATED
-?>
diff --git a/application/hub/main/template/bootstrap/class_XmlDhtBootstrapTemplateEngine.php b/application/hub/main/template/bootstrap/class_XmlDhtBootstrapTemplateEngine.php
deleted file mode 100644 (file)
index 39d2302..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-<?php
-/**
- * An Bootstrap template engine class for XML templates
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- * @todo               This template engine does not make use of setTemplateType()
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
-       /**
-        * Some XML nodes must be available for later data extraction
-        */
-       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA = 'dht-bootstrap-data';
-       const DHT_BOOTSTRAP_DATA_SESSION_ID     = 'session-id';
-       const DHT_BOOTSTRAP_DATA_NODE_STATUS    = 'node-status';
-       const DHT_BOOTSTRAP_DATA_NODE_MODE      = 'node-mode';
-       const DHT_BOOTSTRAP_DATA_EXTERNAL_IP    = 'external-ip';
-       const DHT_BOOTSTRAP_DATA_INTERNAL_IP    = 'internal-ip';
-       const DHT_BOOTSTRAP_DATA_LISTEN_PORT    = 'listen-port';
-
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-
-               // Init array
-               $this->subNodes = array(
-                       self::DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA,
-                       'listener',
-                       self::DHT_BOOTSTRAP_DATA_NODE_STATUS,
-                       self::DHT_BOOTSTRAP_DATA_NODE_MODE,
-                       self::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
-                       self::DHT_BOOTSTRAP_DATA_SESSION_ID,
-                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
-                       self::DHT_BOOTSTRAP_DATA_INTERNAL_IP
-               );
-       }
-
-       /**
-        * Creates an instance of the class TemplateEngine and prepares it for usage
-        *
-        * @return      $templateInstance               An instance of TemplateEngine
-        * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
-        * @throws      InvalidBasePathStringException  If $templateBasePath is no string
-        * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
-        *                                                                                      directory or not found
-        * @throws      BasePathReadProtectedException  If $templateBasePath is
-        *                                                                                      read-protected
-        */
-       public static final function createXmlDhtBootstrapTemplateEngine () {
-               // Get a new instance
-               $templateInstance = new XmlDhtBootstrapTemplateEngine();
-
-               // Init template instance
-               $templateInstance->initXmlTemplateEngine('dht', 'bootstrap');
-
-               // Return the prepared instance
-               return $templateInstance;
-       }
-
-       /**
-        * Currently not used
-        *
-        * @param       $resource               XML parser resource (currently ignored)
-        * @param       $characters             Characters to handle
-        * @return      void
-        */
-       public function characterHandler ($resource, $characters) {
-               // Trim all spaces away
-               $characters = trim($characters);
-
-               // Is this string empty?
-               if (empty($characters)) {
-                       // Then skip it silently
-                       return;
-               } // END - if
-
-               /*
-                * Assign the found characters to variable and use the last entry from
-                * stack as the name.
-                */
-               parent::assignVariable($this->getStackerInstance()->getNamed('dht_bootstrap'), $characters);
-       }
-
-       /**
-        * Getter for cache file (FQFN)
-        *
-        * @return      $fqfn   Full-qualified file name of the menu cache
-        */
-       public function getMenuCacheFqfn () {
-               $this->partialStub('Please implement this method.');
-       }
-
-       /**
-        * Starts the dht bootstrap
-        *
-        * @return      void
-        */
-       protected function startBootstrap () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', 'bootstrap');
-       }
-
-       /**
-        * Starts the dht bootstrap data
-        *
-        * @return      void
-        */
-       protected function startDhtBootstrapData () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA);
-       }
-
-       /**
-        * Starts the node status
-        *
-        * @return      void
-        */
-       protected function startNodeStatus () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_NODE_STATUS);
-       }
-
-       /**
-        * Starts the node-mode
-        *
-        * @return      void
-        */
-       protected function startNodeMode () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_NODE_MODE);
-       }
-
-       /**
-        * Starts the listener
-        *
-        * @return      void
-        */
-       protected function startListener () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', 'listener');
-       }
-
-       /**
-        * Starts the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function startListenPort () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_LISTEN_PORT);
-       }
-
-       /**
-        * Starts the session id
-        *
-        * @return      void
-        */
-       protected function startSessionId () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_SESSION_ID);
-       }
-
-       /**
-        * Starts the public ip
-        *
-        * @return      void
-        */
-       protected function startExternalIp () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP);
-       }
-
-       /**
-        * Starts the private ip
-        *
-        * @return      void
-        */
-       protected function startInternalIp () {
-               // Push the node name on the stacker
-               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_IP);
-       }
-
-       /**
-        * Finishes the session id
-        *
-        * @return      void
-        */
-       protected function finishSessionId () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the private ip
-        *
-        * @return      void
-        */
-       protected function finishInternalIp () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the public ip
-        *
-        * @return      void
-        */
-       protected function finishExternalIp () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the TCP/UDP listen port
-        *
-        * @return      void
-        */
-       protected function finishListenPort () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the listener
-        *
-        * @return      void
-        */
-       protected function finishListener () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the node mode
-        *
-        * @return      void
-        */
-       protected function finishNodeMode () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the node status
-        *
-        * @return      void
-        */
-       protected function finishNodeStatus () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the dht bootstrap data
-        *
-        * @return      void
-        */
-       protected function finishDhtBootstrapData () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-
-       /**
-        * Finishes the dht bootstrap
-        *
-        * @return      void
-        */
-       protected function finishBootstrap () {
-               // Pop the last entry
-               $this->getStackerInstance()->popNamed('dht_bootstrap');
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/hub/main/template/dht/.htaccess b/application/hub/main/template/dht/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/template/dht/class_XmlBootstrapTemplateEngine.php b/application/hub/main/template/dht/class_XmlBootstrapTemplateEngine.php
new file mode 100644 (file)
index 0000000..f551ef4
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+// @DEPRECATED
+?>
diff --git a/application/hub/main/template/dht/class_XmlDhtBootstrapTemplateEngine.php b/application/hub/main/template/dht/class_XmlDhtBootstrapTemplateEngine.php
new file mode 100644 (file)
index 0000000..efb5f88
--- /dev/null
@@ -0,0 +1,296 @@
+<?php
+/**
+ * An Bootstrap template engine class for XML templates
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ * @todo               This template engine does not make use of setTemplateType()
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class XmlDhtBootstrapTemplateEngine extends BaseXmlTemplateEngine implements CompileableTemplate, Registerable {
+       /**
+        * Some XML nodes must be available for later data extraction
+        */
+       const DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA = 'dht-bootstrap-data';
+       const DHT_BOOTSTRAP_DATA_SESSION_ID     = 'session-id';
+       const DHT_BOOTSTRAP_DATA_NODE_STATUS    = 'node-status';
+       const DHT_BOOTSTRAP_DATA_NODE_MODE      = 'node-mode';
+       const DHT_BOOTSTRAP_DATA_EXTERNAL_IP    = 'external-ip';
+       const DHT_BOOTSTRAP_DATA_INTERNAL_IP    = 'internal-ip';
+       const DHT_BOOTSTRAP_DATA_LISTEN_PORT    = 'listen-port';
+
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Init array
+               $this->subNodes = array(
+                       self::DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA,
+                       'listener',
+                       self::DHT_BOOTSTRAP_DATA_NODE_STATUS,
+                       self::DHT_BOOTSTRAP_DATA_NODE_MODE,
+                       self::DHT_BOOTSTRAP_DATA_LISTEN_PORT,
+                       self::DHT_BOOTSTRAP_DATA_SESSION_ID,
+                       self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP,
+                       self::DHT_BOOTSTRAP_DATA_INTERNAL_IP
+               );
+       }
+
+       /**
+        * Creates an instance of the class TemplateEngine and prepares it for usage
+        *
+        * @return      $templateInstance               An instance of TemplateEngine
+        * @throws      BasePathIsEmptyException                If the provided $templateBasePath is empty
+        * @throws      InvalidBasePathStringException  If $templateBasePath is no string
+        * @throws      BasePathIsNoDirectoryException  If $templateBasePath is no
+        *                                                                                      directory or not found
+        * @throws      BasePathReadProtectedException  If $templateBasePath is
+        *                                                                                      read-protected
+        */
+       public static final function createXmlDhtBootstrapTemplateEngine () {
+               // Get a new instance
+               $templateInstance = new XmlDhtBootstrapTemplateEngine();
+
+               // Init template instance
+               $templateInstance->initXmlTemplateEngine('node', 'dht_bootstrap');
+
+               // Return the prepared instance
+               return $templateInstance;
+       }
+
+       /**
+        * Currently not used
+        *
+        * @param       $resource               XML parser resource (currently ignored)
+        * @param       $characters             Characters to handle
+        * @return      void
+        */
+       public function characterHandler ($resource, $characters) {
+               // Trim all spaces away
+               $characters = trim($characters);
+
+               // Is this string empty?
+               if (empty($characters)) {
+                       // Then skip it silently
+                       return;
+               } // END - if
+
+               /*
+                * Assign the found characters to variable and use the last entry from
+                * stack as the name.
+                */
+               parent::assignVariable($this->getStackerInstance()->getNamed('dht_bootstrap'), $characters);
+       }
+
+       /**
+        * Getter for cache file (FQFN)
+        *
+        * @return      $fqfn   Full-qualified file name of the menu cache
+        */
+       public function getMenuCacheFqfn () {
+               $this->partialStub('Please implement this method.');
+       }
+
+       /**
+        * Starts the dht bootstrap
+        *
+        * @return      void
+        */
+       protected function startBootstrap () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', 'bootstrap');
+       }
+
+       /**
+        * Starts the dht bootstrap data
+        *
+        * @return      void
+        */
+       protected function startDhtBootstrapData () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_BOOTSTRAP_DATA);
+       }
+
+       /**
+        * Starts the node status
+        *
+        * @return      void
+        */
+       protected function startNodeStatus () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_NODE_STATUS);
+       }
+
+       /**
+        * Starts the node-mode
+        *
+        * @return      void
+        */
+       protected function startNodeMode () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_NODE_MODE);
+       }
+
+       /**
+        * Starts the listener
+        *
+        * @return      void
+        */
+       protected function startListener () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', 'listener');
+       }
+
+       /**
+        * Starts the TCP/UDP listen port
+        *
+        * @return      void
+        */
+       protected function startListenPort () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_LISTEN_PORT);
+       }
+
+       /**
+        * Starts the public ip
+        *
+        * @return      void
+        */
+       protected function startExternalIp () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_EXTERNAL_IP);
+       }
+
+       /**
+        * Starts the private ip
+        *
+        * @return      void
+        */
+       protected function startInternalIp () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_INTERNAL_IP);
+       }
+
+       /**
+        * Starts the session id
+        *
+        * @return      void
+        */
+       protected function startSessionId () {
+               // Push the node name on the stacker
+               $this->getStackerInstance()->pushNamed('dht_bootstrap', self::DHT_BOOTSTRAP_DATA_SESSION_ID);
+       }
+
+       /**
+        * Finishes the session id
+        *
+        * @return      void
+        */
+       protected function finishSessionId () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the private ip
+        *
+        * @return      void
+        */
+       protected function finishInternalIp () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the public ip
+        *
+        * @return      void
+        */
+       protected function finishExternalIp () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the TCP/UDP listen port
+        *
+        * @return      void
+        */
+       protected function finishListenPort () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the listener
+        *
+        * @return      void
+        */
+       protected function finishListener () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the node mode
+        *
+        * @return      void
+        */
+       protected function finishNodeMode () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the node status
+        *
+        * @return      void
+        */
+       protected function finishNodeStatus () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the dht bootstrap data
+        *
+        * @return      void
+        */
+       protected function finishDhtBootstrapData () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+
+       /**
+        * Finishes the dht bootstrap
+        *
+        * @return      void
+        */
+       protected function finishBootstrap () {
+               // Pop the last entry
+               $this->getStackerInstance()->popNamed('dht_bootstrap');
+       }
+}
+
+// [EOF]
+?>
index 2f5621197bd788418fd3a3f5a411fc5403588bff..fc3ff943e4b7049880b7a81a6ee87340ecd9a255 100644 (file)
@@ -76,7 +76,7 @@ class XmlDhtPublishEntryTemplateEngine extends BaseXmlTemplateEngine implements
                $templateInstance = new XmlDhtPublishEntryTemplateEngine();
 
                // Init template instance
-               $templateInstance->initXmlTemplateEngine('dht', 'publish');
+               $templateInstance->initXmlTemplateEngine('node', 'dht_publish');
 
                // Return the prepared instance
                return $templateInstance;