]> git.mxchange.org Git - city.git/commitdiff
Renamed many classes as they are only for the daemon + added a task which will
authorRoland Haeder <roland@mxchange.org>
Wed, 10 Jun 2015 18:22:55 +0000 (20:22 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 10 Jun 2015 18:22:55 +0000 (20:22 +0200)
expand the map.

Signed-off-by: Roland Haeder <roland@mxchange.org>
28 files changed:
application/city/config.php
application/city/main/commands/console/class_CityConsoleDaemonCommand.php
application/city/main/filter/city/.htaccess [deleted file]
application/city/main/filter/city/class_City [deleted file]
application/city/main/filter/city/class_CityInitializationFilter.php [deleted file]
application/city/main/filter/city/class_CityPhpRequirementsFilter.php [deleted file]
application/city/main/filter/city/class_CityWelcomeTeaserFilter.php [deleted file]
application/city/main/filter/city_daemon/.htaccess [new file with mode: 0644]
application/city/main/filter/city_daemon/class_CityDaemon [new file with mode: 0644]
application/city/main/filter/city_daemon/class_CityDaemonInitializationFilter.php [new file with mode: 0644]
application/city/main/filter/city_daemon/class_CityDaemonPhpRequirementsFilter.php [new file with mode: 0644]
application/city/main/filter/city_daemon/class_CityDaemonWelcomeTeaserFilter.php [new file with mode: 0644]
application/city/main/filter/shutdown/city/class_CityDaemonShutdown [new file with mode: 0644]
application/city/main/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php [new file with mode: 0644]
application/city/main/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php [new file with mode: 0644]
application/city/main/filter/shutdown/city/class_CityShutdown [deleted file]
application/city/main/filter/shutdown/city/class_CityShutdownCityFilter.php [deleted file]
application/city/main/filter/shutdown/city/class_CityShutdownTaskHandlerFilter.php [deleted file]
application/city/main/filter/task/city/.htaccess [deleted file]
application/city/main/filter/task/city/class_CityTaskHandlerInitializerFilter.php [deleted file]
application/city/main/filter/task/city_daemon/.htaccess [new file with mode: 0644]
application/city/main/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php [new file with mode: 0644]
application/city/main/tasks/.htaccess [new file with mode: 0644]
application/city/main/tasks/daemon/.htaccess [new file with mode: 0644]
application/city/main/tasks/daemon/city_map/.htaccess [new file with mode: 0644]
application/city/main/tasks/daemon/city_map/class_CityDaemonMapExpanderTask.php [new file with mode: 0644]
application/city/main/tasks/daemon/class_CityDaemon [new file with mode: 0644]
core

index 6487ec087b614942b4f716d4d720967242eb1b91..527502cc0124bf16e0edfe0eb3d546e49743fa43 100644 (file)
@@ -483,7 +483,7 @@ $cfg->setConfigEntry('region_manager_class', 'RegionManager');
 $cfg->setConfigEntry('region_map_manager_class', 'RegionMapManager');
 
 /******************************************************************************
- *                              Console client                                *
+ *                                  Daemon                                    *
  ******************************************************************************/
 
 // CFG: DEFAULT-CONSOLE-COMMAND
@@ -498,23 +498,23 @@ $cfg->setConfigEntry('default_city_console_controller', 'daemon');
 // CFG: CITY-CONSOLE-CMD-DAEMON-RESOLVER-CLASS
 $cfg->setConfigEntry('city_console_cmd_daemon_resolver_class', 'CityConsoleCommandResolver');
 
-// CFG: CITY-PHP-REQUIREMENTS-FILTER
-$cfg->setConfigEntry('city_php_requirements_filter', 'CityPhpRequirementsFilter');
+// CFG: CITY-DAEMON-PHP-REQUIREMENTS-FILTER
+$cfg->setConfigEntry('city_daemon_php_requirements_filter', 'CityDaemonPhpRequirementsFilter');
 
-// CFG: CITY-INITIALIZER-FILTER
-$cfg->setConfigEntry('city_initializer_filter', 'CityInitializationFilter');
+// CFG: CITY-DAEMON-INITIALIZER-FILTER
+$cfg->setConfigEntry('city_daemon_initializer_filter', 'CityDaemonInitializationFilter');
 
-// CFG: CITY-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER
-$cfg->setConfigEntry('city_activation_task_handler_initializer_filter', 'CityTaskHandlerInitializerFilter');
+// CFG: CITY-DAEMON-ACTIVATION-TASK-HANDLER-INITIALIZER-FILTER
+$cfg->setConfigEntry('city_daemon_activation_task_handler_initializer_filter', 'CityDaemonTaskHandlerInitializerFilter');
 
-// CFG: CITY-WELCOME-TEASER-FILTER
-$cfg->setConfigEntry('city_welcome_teaser_filter', 'CityWelcomeTeaserFilter');
+// CFG: CITY-DAEMON-WELCOME-TEASER-FILTER
+$cfg->setConfigEntry('city_daemon_welcome_teaser_filter', 'CityDaemonWelcomeTeaserFilter');
 
-// CFG: CITY-SHUTDOWN-TASK-HANDLER-FILTER
-$cfg->setConfigEntry('city_shutdown_task_handler_filter', 'CityShutdownTaskHandlerFilter');
+// CFG: CITY-DAEMON-SHUTDOWN-TASK-HANDLER-FILTER
+$cfg->setConfigEntry('city_daemon_shutdown_task_handler_filter', 'CityDaemonShutdownTaskHandlerFilter');
 
-// CFG: CITY-SHUTDOWN-CITY-FILTER
-$cfg->setConfigEntry('city_shutdown_city_filter', 'CityShutdownCityFilter');
+// CFG: CITY-DAEMON-SHUTDOWN-CITY-FILTER
+$cfg->setConfigEntry('city_daemon_shutdown_city_filter', 'CityDaemonShutdownCityFilter');
 
 // CFG: NEWS-READER-DAEMON-CLASS
 $cfg->setConfigEntry('news_reader_daemon_class', 'ConsoleNewsReader');
@@ -522,5 +522,17 @@ $cfg->setConfigEntry('news_reader_daemon_class', 'ConsoleNewsReader');
 // CFG: NEWS-DAEMON-LIMIT
 $cfg->setConfigEntry('news_daemon_limit', 5);
 
+// CFG: CITY-DAEMON-MAP-EXPANDER-TASK-CLASS
+$cfg->setConfigEntry('city_daemon_map_expander_task_class', 'CityDaemonMapExpanderTask');
+
+// CFG: TASK-MAP-EXPANDER-STARTUP-DELAY
+$cfg->setConfigEntry('task_map_expander_startup_delay', 500);
+
+// CFG: TASK-MAP-EXPANDER-INTERVAL-DELAY
+$cfg->setConfigEntry('task_map_expander_interval_delay', 100);
+
+// CFG: TASK-MAP-EXPANDER-MAX-RUNS
+$cfg->setConfigEntry('task_map_expander_max_runs', 0);
+
 // [EOF]
 ?>
index 53b0ea22e538ff0d92ee1091f197da7ce73f8901..4dfed6bf5e2f02f27f766497b7f127f79ecc3bfd 100644 (file)
@@ -115,21 +115,21 @@ class CityConsoleDaemonCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Add pre filters
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_php_requirements_filter'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_initializer_filter'));
-               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_welcome_teaser_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_php_requirements_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_initializer_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_welcome_teaser_filter'));
 
                // Add bootstrap filters
-               //$controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('city_bootstrap_generate_cityid_filter'));
+               //$controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_bootstrap_generate_cityid_filter'));
 
                // Add city activation filters
-               $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('city_activation_task_handler_initializer_filter'));
+               $controllerInstance->addActivationFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_activation_task_handler_initializer_filter'));
 
                // Add shutdown filters
-               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('city_shutdown_task_handler_filter'));
+               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_shutdown_task_handler_filter'));
 
                // This is the last generic shutdown filter
-               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('city_shutdown_city_filter'));
+               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('city_daemon_shutdown_city_filter'));
        }
 }
 
diff --git a/application/city/main/filter/city/.htaccess b/application/city/main/filter/city/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/city/main/filter/city/class_City b/application/city/main/filter/city/class_City
deleted file mode 100644 (file)
index 75aa344..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * A ??? filter for citys
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * 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 City???Filter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createCity???Filter () {
-               // Get a new instance
-               $filterInstance = new City???Filter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Implement this!
-               $this->partialStub('Please implement this method.');
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/city/class_CityInitializationFilter.php b/application/city/main/filter/city/class_CityInitializationFilter.php
deleted file mode 100644 (file)
index 9175586..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-/**
- * A Initialization filter for cities
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityInitializationFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityInitializationFilter () {
-               // Get a new instance
-               $filterInstance = new CityInitializationFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Try to instance it by using a factory
-               try {
-                       // Get an instance
-                       $cityInstance = CityObjectFactory::createCityInstance($requestInstance, $responseInstance);
-               } catch (ClassNotFoundException $e) {
-                       // This exception means, the city mode is invalid.
-                       // @TODO Can we rewrite this to app_exit() ?
-                       $this->debugBackTrace('[' . __METHOD__ . ':' . __LINE__ . ']:  city mode ' . $cityMode . ' is invalid.');
-               }
-
-               // Set the city instance in registry
-               Registry::getRegistry()->addInstance('city', $cityInstance);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE-INIT-FILTER[' . __METHOD__ . ':' . __LINE__ . ']: City ' . $cityMode . ' has been added to registry.');
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/city/class_CityPhpRequirementsFilter.php b/application/city/main/filter/city/class_CityPhpRequirementsFilter.php
deleted file mode 100644 (file)
index 307de6f..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * A PhpRequirements filter for cities
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityPhpRequirementsFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityPhpRequirementsFilter () {
-               // Get a new instance
-               $filterInstance = new CityPhpRequirementsFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If a required PHP function is not available
-        * @todo        Add more test and try to add an extra message to the thrown exception
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // By default, the requirement check is passed and zero checks are failed
-               $checkPassed = TRUE;
-               $checksFailed = 0;
-
-               // Are all tests passed?
-               if ($checkPassed === FALSE) {
-                       // Throw an exception
-                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } // END - if
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/city/class_CityWelcomeTeaserFilter.php b/application/city/main/filter/city/class_CityWelcomeTeaserFilter.php
deleted file mode 100644 (file)
index 8fc2917..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * A welcome-teaser filter for the console
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityWelcomeTeaserFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityWelcomeTeaserFilter () {
-               // Get a new instance
-               $filterInstance = new CityWelcomeTeaserFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
-        * @todo        Handle over the $responseInstance to outputConsoleTeaser()
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get city instance
-               $cityInstance = CityObjectFactory::createCityInstance();
-
-               // Now output the teaser
-               $cityInstance->outputConsoleTeaser();
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/city_daemon/.htaccess b/application/city/main/filter/city_daemon/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/city/main/filter/city_daemon/class_CityDaemon b/application/city/main/filter/city_daemon/class_CityDaemon
new file mode 100644 (file)
index 0000000..e5e2f4d
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * A ??? filter for citys
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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 CityDaemon???Filter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createCityDaemon???Filter () {
+               // Get a new instance
+               $filterInstance = new CityDaemon???Filter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Implement this!
+               $this->partialStub('Please implement this method.');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/city_daemon/class_CityDaemonInitializationFilter.php b/application/city/main/filter/city_daemon/class_CityDaemonInitializationFilter.php
new file mode 100644 (file)
index 0000000..73a78a0
--- /dev/null
@@ -0,0 +1,73 @@
+<?php
+/**
+ * A Initialization filter for cities
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonInitializationFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonInitializationFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonInitializationFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Try to instance it by using a factory
+               try {
+                       // Get an instance
+                       $cityInstance = CityObjectFactory::createCityInstance($requestInstance, $responseInstance);
+               } catch (ClassNotFoundException $e) {
+                       // This exception means, the city mode is invalid.
+                       // @TODO Can we rewrite this to app_exit() ?
+                       $this->debugBackTrace('[' . __METHOD__ . ':' . __LINE__ . ']:  city mode ' . $cityMode . ' is invalid.');
+               }
+
+               // Set the city instance in registry
+               Registry::getRegistry()->addInstance('city', $cityInstance);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NODE-INIT-FILTER[' . __METHOD__ . ':' . __LINE__ . ']: City ' . $cityMode . ' has been added to registry.');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/city_daemon/class_CityDaemonPhpRequirementsFilter.php b/application/city/main/filter/city_daemon/class_CityDaemonPhpRequirementsFilter.php
new file mode 100644 (file)
index 0000000..8ee57a4
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * A PhpRequirements filter for cities
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonPhpRequirementsFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonPhpRequirementsFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonPhpRequirementsFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If a required PHP function is not available
+        * @todo        Add more test and try to add an extra message to the thrown exception
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // By default, the requirement check is passed and zero checks are failed
+               $checkPassed = TRUE;
+               $checksFailed = 0;
+
+               // Are all tests passed?
+               if ($checkPassed === FALSE) {
+                       // Throw an exception
+                       throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/city_daemon/class_CityDaemonWelcomeTeaserFilter.php b/application/city/main/filter/city_daemon/class_CityDaemonWelcomeTeaserFilter.php
new file mode 100644 (file)
index 0000000..936980c
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * A welcome-teaser filter for the console
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonWelcomeTeaserFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonWelcomeTeaserFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonWelcomeTeaserFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
+        * @todo        Handle over the $responseInstance to outputConsoleTeaser()
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get city instance
+               $cityInstance = CityObjectFactory::createCityInstance();
+
+               // Now output the teaser
+               $cityInstance->outputConsoleTeaser();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/shutdown/city/class_CityDaemonShutdown b/application/city/main/filter/shutdown/city/class_CityDaemonShutdown
new file mode 100644 (file)
index 0000000..9ad60d4
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * A ??? filter for shutting down the city.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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 CityDaemonShutdown???Filter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createCityDaemonShutdown???Filter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonShutdown???Filter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get city instance
+               $cityInstance = Registry::getRegistry()->getInstance('city');
+
+               // Now do something
+               $this->partialStub('Please implement this step.');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php b/application/city/main/filter/shutdown/city/class_CityDaemonShutdownCityFilter.php
new file mode 100644 (file)
index 0000000..624d2f2
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * A ShutdownCity filter for shutting down the city. This filter should be the
+ * last one in 'shutdown' chain so the hub is shutted down at the very end of
+ * its life... R.I.P. little hub...
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonShutdownCityFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonShutdownCityFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonShutdownCityFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException please)
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get city instance
+               $cityInstance = CityObjectFactory::createCityInstance();
+
+               // Shutdown the city. This should be the last line
+               $cityInstance->doShutdown();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php b/application/city/main/filter/shutdown/city/class_CityDaemonShutdownTaskHandlerFilter.php
new file mode 100644 (file)
index 0000000..a80fdae
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * A TaskHandler filter for shutting down the city.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonShutdownTaskHandlerFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonShutdownTaskHandlerFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonShutdownTaskHandlerFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get task handler instance
+               $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
+
+               // Shutdown the task manager and all its registered tasks
+               $handlerInstance->doShutdown();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/filter/shutdown/city/class_CityShutdown b/application/city/main/filter/shutdown/city/class_CityShutdown
deleted file mode 100644 (file)
index 60201db..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * A ??? filter for shutting down the city.
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * 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 CityShutdown???Filter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public final static function createCityShutdown???Filter () {
-               // Get a new instance
-               $filterInstance = new CityShutdown???Filter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get city instance
-               $cityInstance = Registry::getRegistry()->getInstance('city');
-
-               // Now do something
-               $this->partialStub('Please implement this step.');
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/shutdown/city/class_CityShutdownCityFilter.php b/application/city/main/filter/shutdown/city/class_CityShutdownCityFilter.php
deleted file mode 100644 (file)
index 0b48c5a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/**
- * A ShutdownCity filter for shutting down the city. This filter should be the
- * last one in 'shutdown' chain so the hub is shutted down at the very end of
- * its life... R.I.P. little hub...
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityShutdownCityFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityShutdownCityFilter () {
-               // Get a new instance
-               $filterInstance = new CityShutdownCityFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException please)
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get city instance
-               $cityInstance = CityObjectFactory::createCityInstance();
-
-               // Shutdown the city. This should be the last line
-               $cityInstance->doShutdown();
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/shutdown/city/class_CityShutdownTaskHandlerFilter.php b/application/city/main/filter/shutdown/city/class_CityShutdownTaskHandlerFilter.php
deleted file mode 100644 (file)
index 18dfe61..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
- * A TaskHandler filter for shutting down the city.
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityShutdownTaskHandlerFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityShutdownTaskHandlerFilter () {
-               // Get a new instance
-               $filterInstance = new CityShutdownTaskHandlerFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If $cityInstance is null (no NullPointerException here)
-        * @todo        0% done
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get task handler instance
-               $handlerInstance = Registry::getRegistry()->getInstance('task_handler');
-
-               // Shutdown the task manager and all its registered tasks
-               $handlerInstance->doShutdown();
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/task/city/.htaccess b/application/city/main/filter/task/city/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/application/city/main/filter/task/city/class_CityTaskHandlerInitializerFilter.php b/application/city/main/filter/task/city/class_CityTaskHandlerInitializerFilter.php
deleted file mode 100644 (file)
index 384421a..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php
-/**
- * A TaskHandlerInitializer filter for hubs
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2015 City Developer Team
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.shipsimu.org
- *
- * 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 CityTaskHandlerInitializerFilter extends BaseCityFilter implements Filterable {
-       /**
-        * Protected constructor
-        *
-        * @return      void
-        */
-       protected function __construct () {
-               // Call parent constructor
-               parent::__construct(__CLASS__);
-       }
-
-       /**
-        * Creates an instance of this filter class
-        *
-        * @return      $filterInstance         An instance of this filter class
-        */
-       public static final function createCityTaskHandlerInitializerFilter () {
-               // Get a new instance
-               $filterInstance = new CityTaskHandlerInitializerFilter();
-
-               // Return the instance
-               return $filterInstance;
-       }
-
-       /**
-        * Executes the filter with given request and response objects
-        *
-        * @param       $requestInstance        An instance of a class with an Requestable interface
-        * @param       $responseInstance       An instance of a class with an Responseable interface
-        * @return      void
-        * @throws      FilterChainException    If the filter chain needs to be interrupted
-        * @todo        Add more tasks
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get city instance
-               $cityInstance = CityObjectFactory::createCityInstance();
-
-               // Get a new task handler instance
-               $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
-
-               // Put the task handler in registry
-               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
-
-               // Prepare a package-tags initialization task for the listeners
-               //$taskInstance = ObjectFactory::createObjectByConfiguredName('city_package_tags_init_task_class');
-
-               // Register it
-               //$handlerInstance->registerTask('package_tags_init', $taskInstance);
-
-               /*
-                * Allow extra city-depending tasks, e.g. the bootstrapper city needs
-                * booting its DHT. DHTs are decentralized and are working on
-                * peer-to-peer basis.
-                */
-               $cityInstance->addExtraTasks($handlerInstance);
-       }
-}
-
-// [EOF]
-?>
diff --git a/application/city/main/filter/task/city_daemon/.htaccess b/application/city/main/filter/task/city_daemon/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/city/main/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php b/application/city/main/filter/task/city_daemon/class_CityDaemonTaskHandlerInitializerFilter.php
new file mode 100644 (file)
index 0000000..542aa27
--- /dev/null
@@ -0,0 +1,83 @@
+<?php
+/**
+ * A TaskHandlerInitializer filter for hubs
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2015 City Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.shipsimu.org
+ *
+ * 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 CityDaemonTaskHandlerInitializerFilter extends BaseCityFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public static final function createCityDaemonTaskHandlerInitializerFilter () {
+               // Get a new instance
+               $filterInstance = new CityDaemonTaskHandlerInitializerFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @throws      FilterChainException    If the filter chain needs to be interrupted
+        * @todo        Add more tasks
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get city instance
+               $cityInstance = CityObjectFactory::createCityInstance();
+
+               // Get a new task handler instance
+               $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
+
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task_handler', $handlerInstance);
+
+               // Prepare a map-expanding task
+               $taskInstance = ObjectFactory::createObjectByConfiguredName('city_daemon_map_expander_task_class');
+
+               // Register it
+               $handlerInstance->registerTask('map_expander', $taskInstance);
+
+               /*
+                * Allow extra city-depending tasks, e.g. the bootstrapper city needs
+                * booting its DHT. DHTs are decentralized and are working on
+                * peer-to-peer basis.
+                */
+               $cityInstance->addExtraTasks($handlerInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/tasks/.htaccess b/application/city/main/tasks/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/city/main/tasks/daemon/.htaccess b/application/city/main/tasks/daemon/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/city/main/tasks/daemon/city_map/.htaccess b/application/city/main/tasks/daemon/city_map/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/city/main/tasks/daemon/city_map/class_CityDaemonMapExpanderTask.php b/application/city/main/tasks/daemon/city_map/class_CityDaemonMapExpanderTask.php
new file mode 100644 (file)
index 0000000..6c0dad5
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * A MapExpander city daemon-task
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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 CityDaemonMapExpanderTask extends BaseTask implements Taskable, Visitable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $taskInstance   An instance of a Visitable class
+        */
+       public final static function createCityDaemonMapExpanderTask () {
+               // Get new instance
+               $taskInstance = new CityDaemonMapExpanderTask();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visitor
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        * @todo        Maybe visit some sub-objects
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit this task
+               $visitorInstance->visitTask($this);
+       }
+
+       /**
+        * Executes the task
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function executeTask () {
+               $this->partialStub('Unimplemented task.');
+       }
+
+       /**
+        * Shuts down the task
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function doShutdown () {
+               self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/city/main/tasks/daemon/class_CityDaemon b/application/city/main/tasks/daemon/class_CityDaemon
new file mode 100644 (file)
index 0000000..48e0724
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * A ??? city daemon-task
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * 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 CityDaemon???Task extends BaseTask implements Taskable, Visitable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $taskInstance   An instance of a Visitable class
+        */
+       public final static function createCityDaemon???Task () {
+               // Get new instance
+               $taskInstance = new CityDaemon???Task();
+
+               // Return the prepared instance
+               return $taskInstance;
+       }
+
+       /**
+        * Accepts the visitor to process the visitor
+        *
+        * @param       $visitorInstance        An instance of a Visitor class
+        * @return      void
+        * @todo        Maybe visit some sub-objects
+        */
+       public function accept (Visitor $visitorInstance) {
+               // Visit this task
+               $visitorInstance->visitTask($this);
+       }
+
+       /**
+        * Executes the task
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function executeTask () {
+               $this->partialStub('Unimplemented task.');
+       }
+
+       /**
+        * Shuts down the task
+        *
+        * @return      void
+        * @todo        0% done
+        */
+       public function doShutdown () {
+               self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...');
+       }
+}
+
+// [EOF]
+?>
diff --git a/core b/core
index b2caf380b85fbe804d7464ecc1bfe60aafcbc7d9..cc0e0b439900fd1ffb882f9150f37dd3eb8d301d 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit b2caf380b85fbe804d7464ecc1bfe60aafcbc7d9
+Subproject commit cc0e0b439900fd1ffb882f9150f37dd3eb8d301d