]> git.mxchange.org Git - hub.git/commitdiff
Basic (non-functional) classes added for a chat console (ever want to 'chat' or ...
authorRoland Häder <roland@mxchange.org>
Thu, 26 May 2011 04:14:04 +0000 (04:14 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 26 May 2011 04:14:04 +0000 (04:14 +0000)
28 files changed:
.gitattributes
application/hub/config.php
application/hub/interfaces/chat/.htaccess [new file with mode: 0644]
application/hub/interfaces/chat/class_Chatter.php [new file with mode: 0644]
application/hub/main/chat/.htaccess [new file with mode: 0644]
application/hub/main/chat/class_ [new file with mode: 0644]
application/hub/main/chat/class_BaseNodeChat.php [new file with mode: 0644]
application/hub/main/chat/console/.htaccess [new file with mode: 0644]
application/hub/main/chat/console/class_NodeConsoleChat.php [new file with mode: 0644]
application/hub/main/commands/console/class_HubConsoleChatCommand.php [new file with mode: 0644]
application/hub/main/commands/console/class_HubConsoleCruncherCommand.php
application/hub/main/controller/console/class_HubConsoleChatController.php [new file with mode: 0644]
application/hub/main/filter/bootstrap/chat/.htaccess [new file with mode: 0644]
application/hub/main/filter/bootstrap/chat/class_ChatBootstrap [new file with mode: 0644]
application/hub/main/filter/bootstrap/chat/class_ChatBootstrapExtraBootstrappingFilter.php [new file with mode: 0644]
application/hub/main/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php [new file with mode: 0644]
application/hub/main/filter/bootstrap/cruncher/class_CruncherBootstrap
application/hub/main/filter/chat/.htaccess [new file with mode: 0644]
application/hub/main/filter/chat/class_ChatInitializationFilter.php [new file with mode: 0644]
application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php [new file with mode: 0644]
application/hub/main/filter/chat/class_ChatWelcomeTeaserFilter.php [new file with mode: 0644]
application/hub/main/filter/cruncher/class_CruncherWelcomeTeaserFilter.php
application/hub/main/filter/shutdown/chat/.htaccess [new file with mode: 0644]
application/hub/main/filter/shutdown/chat/class_ChatShutdownFilter.php [new file with mode: 0644]
application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php
application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownFilter.php [new file with mode: 0644]
application/hub/main/filter/task/chat/.htaccess [new file with mode: 0644]
application/hub/main/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php [new file with mode: 0644]

index 1178a29f4e0ed8c07cdb654e962a2a69f6fb4cd2..dc18b2b64aec7b5be2c2e84edbe1e124b7f0e702 100644 (file)
@@ -28,6 +28,8 @@ application/hub/exceptions/tasks/.htaccess -text svneol=unset#text/plain
 application/hub/exceptions/tasks/class_InvalidTaskException.php svneol=native#text/plain
 application/hub/init.php svneol=native#text/plain
 application/hub/interfaces/.htaccess -text svneol=unset#text/plain
+application/hub/interfaces/chat/.htaccess svneol=native#text/plain
+application/hub/interfaces/chat/class_Chatter.php svneol=native#text/plain
 application/hub/interfaces/connectors/.htaccess -text svneol=unset#text/plain
 application/hub/interfaces/connectors/class_Connectable.php svneol=native#text/plain
 application/hub/interfaces/consumer/.htaccess svneol=native#text/plain
@@ -125,10 +127,16 @@ application/hub/interfaces/work_units/.htaccess svneol=native#text/plain
 application/hub/interfaces/work_units/class_UnitHelper.php svneol=native#text/plain
 application/hub/loader.php svneol=native#text/plain
 application/hub/main/.htaccess -text svneol=unset#text/plain
+application/hub/main/chat/.htaccess svneol=native#text/plain
+application/hub/main/chat/class_ -text
+application/hub/main/chat/class_BaseNodeChat.php svneol=native#text/plain
+application/hub/main/chat/console/.htaccess svneol=native#text/plain
+application/hub/main/chat/console/class_NodeConsoleChat.php svneol=native#text/plain
 application/hub/main/class_ svneol=native#text/plain
 application/hub/main/class_BaseHubSystem.php svneol=native#text/plain
 application/hub/main/commands/.htaccess -text svneol=unset#text/plain
 application/hub/main/commands/console/.htaccess -text svneol=unset#text/plain
+application/hub/main/commands/console/class_HubConsoleChatCommand.php svneol=native#text/plain
 application/hub/main/commands/console/class_HubConsoleCruncherCommand.php svneol=native#text/plain
 application/hub/main/commands/console/class_HubConsoleMainCommand.php svneol=native#text/plain
 application/hub/main/compressor/.htaccess -text svneol=unset#text/plain
@@ -148,6 +156,7 @@ application/hub/main/connectors/queues/local/.htaccess -text svneol=unset#text/p
 application/hub/main/connectors/queues/local/class_LocalQueueConnector.php svneol=native#text/plain
 application/hub/main/controller/.htaccess -text svneol=unset#text/plain
 application/hub/main/controller/console/.htaccess -text svneol=unset#text/plain
+application/hub/main/controller/console/class_HubConsoleChatController.php svneol=native#text/plain
 application/hub/main/controller/console/class_HubConsoleCruncherController.php svneol=native#text/plain
 application/hub/main/controller/console/class_HubConsoleDefaultNewsController.php svneol=native#text/plain
 application/hub/main/cruncher/.htaccess svneol=native#text/plain
@@ -205,6 +214,10 @@ application/hub/main/filter/activation/class_HubActivationSelfAnnouncementFilter
 application/hub/main/filter/activation/node/.htaccess svneol=native#text/plain
 application/hub/main/filter/activation/node/class_NodeActivationSelfAnnouncementFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/.htaccess -text svneol=unset#text/plain
+application/hub/main/filter/bootstrap/chat/.htaccess svneol=native#text/plain
+application/hub/main/filter/bootstrap/chat/class_ChatBootstrap -text
+application/hub/main/filter/bootstrap/chat/class_ChatBootstrapExtraBootstrappingFilter.php svneol=native#text/plain
+application/hub/main/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/class_HubBootstrapAquireHubIdFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/class_HubBootstrapExtraBootstrappingFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/class_HubBootstrapGenSessionIdFilter.php svneol=native#text/plain
@@ -224,6 +237,10 @@ application/hub/main/filter/bootstrap/node/class_NodeBootstrapGenerateSessionIdF
 application/hub/main/filter/bootstrap/node/class_NodeBootstrapInitQueuesFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/node/class_NodeBootstrapListenerPoolFilter.php svneol=native#text/plain
 application/hub/main/filter/bootstrap/node/class_NodeBootstrapRestoreNodeListFilter.php svneol=native#text/plain
+application/hub/main/filter/chat/.htaccess svneol=native#text/plain
+application/hub/main/filter/chat/class_ChatInitializationFilter.php svneol=native#text/plain
+application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php svneol=native#text/plain
+application/hub/main/filter/chat/class_ChatWelcomeTeaserFilter.php svneol=native#text/plain
 application/hub/main/filter/class_ svneol=native#text/plain
 application/hub/main/filter/console/.htaccess -text svneol=unset#text/plain
 application/hub/main/filter/console/class_ConsoleWelcomeTeaserFilter.php svneol=native#text/plain
@@ -236,6 +253,8 @@ application/hub/main/filter/node/class_NodeInitializationFilter.php svneol=nativ
 application/hub/main/filter/node/class_NodePhpRequirementsFilter.php svneol=native#text/plain
 application/hub/main/filter/node/class_NodeWelcomeTeaserFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/.htaccess -text svneol=unset#text/plain
+application/hub/main/filter/shutdown/chat/.htaccess svneol=native#text/plain
+application/hub/main/filter/shutdown/chat/class_ChatShutdownFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/class_HubShutdownCruncherFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/class_HubShutdownDeinitQueuesFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/class_HubShutdownFlushNodeListFilter.php svneol=native#text/plain
@@ -244,12 +263,15 @@ application/hub/main/filter/shutdown/class_HubShutdownNodeFilter.php svneol=nati
 application/hub/main/filter/shutdown/class_HubShutdownTaskHandlerFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/cruncher/.htaccess svneol=native#text/plain
 application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownCruncherFilter.php svneol=native#text/plain
+application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/node/.htaccess svneol=native#text/plain
 application/hub/main/filter/shutdown/node/class_NodeShutdownDeinitQueuesFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/node/class_NodeShutdownFlushNodeListFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/node/class_NodeShutdownNodeFilter.php svneol=native#text/plain
 application/hub/main/filter/shutdown/node/class_NodeShutdownTaskHandlerFilter.php svneol=native#text/plain
 application/hub/main/filter/task/.htaccess -text svneol=unset#text/plain
+application/hub/main/filter/task/chat/.htaccess svneol=native#text/plain
+application/hub/main/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php svneol=native#text/plain
 application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php svneol=native#text/plain
 application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php svneol=native#text/plain
 application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php svneol=native#text/plain
index 08db0c4dfb48e789f64e21c649f6225abd84f680..1a32e2c97185cad0ae12730be5ad62d6c14bc26c 100644 (file)
@@ -559,8 +559,8 @@ $cfg->setConfigEntry('cruncher_bootstrap_generic_activation_filter', 'CruncherBo
 // CFG: CRUNCHER-WELCOME-TEASER-FILTER
 $cfg->setConfigEntry('cruncher_welcome_teaser_filter', 'CruncherWelcomeTeaserFilter');
 
-// CFG: CRUNCHER-SHUTDOWN-CRUNCHER-FILTER
-$cfg->setConfigEntry('cruncher_shutdown_cruncher_filter', 'CruncherShutdownCruncherFilter');
+// CFG: CRUNCHER-SHUTDOWN-FILTER
+$cfg->setConfigEntry('cruncher_shutdown_filter', 'CruncherShutdownFilter');
 
 // CFG: CRUNCHER-WORK-UNIT-FETCHER-TASK-CLASS
 $cfg->setConfigEntry('cruncher_work_unit_fetcher_task_class', 'CruncherWorkUnitFetcherTask');
@@ -658,5 +658,36 @@ $cfg->setConfigEntry('cruncher_virgin_state_class', 'CruncherVirginState');
 // CFG: CRUNCHER-PER-UNIT-KEY-LIMIT
 $cfg->setConfigEntry('cruncher_per_unit_key_limit', 10000);
 
+///////////////////////////////////////////////////////////////////////////////
+//                            Chat Configuration
+///////////////////////////////////////////////////////////////////////////////
+
+// CFG: HUBCONSOLE-CMD-CHAT-RESOLVER-CLASS
+$cfg->setConfigEntry('hubconsole_cmd_chat_resolver_class', 'HubConsoleCommandResolver');
+
+// CFG: CHAT-PHP-REQUIREMENTS-FILTER
+$cfg->setConfigEntry('chat_php_requirements_filter', 'ChatPhpRequirementsFilter');
+
+// CFG: CHAT-INITIALIZER-FILTER
+$cfg->setConfigEntry('chat_initializer_filter', 'ChatInitializationFilter');
+
+// CFG: NODE-CONSOLE-CHAT
+$cfg->setConfigEntry('node_console_chat_class', 'NodeConsoleChat');
+
+// CFG: CHAT-WELCOME-TEASER-FILTER
+$cfg->setConfigEntry('chat_welcome_teaser_filter', 'ChatWelcomeTeaserFilter');
+
+// CFG: CHAT-BOOTSTRAP-TASK-HANDLER-INITIALIZER-FILTER
+$cfg->setConfigEntry('chat_bootstrap_task_handler_initializer_filter', 'ChatTaskHandlerInitializerFilter');
+
+// CFG: CHAT-BOOTSTRAP-EXTRA-BOOTSTRAPPING-FILTER
+$cfg->setConfigEntry('chat_bootstrap_extra_bootstrapping_filter', 'ChatBootstrapExtraBootstrappingFilter');
+
+// CFG: CHAT-BOOTSTRAP-GENERIC-ACTIVATION-FILTER
+$cfg->setConfigEntry('chat_bootstrap_generic_activation_filter', 'ChatBootstrapGenericActivationFilter');
+
+// CFG: CHAT-SHUTDOWN-FILTER
+$cfg->setConfigEntry('chat_shutdown_filter', 'ChatShutdownFilter');
+
 // [EOF]
 ?>
diff --git a/application/hub/interfaces/chat/.htaccess b/application/hub/interfaces/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/interfaces/chat/class_Chatter.php b/application/hub/interfaces/chat/class_Chatter.php
new file mode 100644 (file)
index 0000000..f92865e
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for chatter
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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/>.
+ */
+interface Chatter extends FrameworkInterface {
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/chat/.htaccess b/application/hub/main/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/chat/class_ b/application/hub/main/chat/class_
new file mode 100644 (file)
index 0000000..7d7325b
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A node ??? chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 Node???Chat extends BaseNodeChat implements Chatter {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $chatInstance   An instance of a Chatter class
+        */
+       public final static function createNode???Chat () {
+               // Get new instance
+               $chatInstance = new Node???Chat();
+
+               // Return the prepared instance
+               return $chatInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/chat/class_BaseNodeChat.php b/application/hub/main/chat/class_BaseNodeChat.php
new file mode 100644 (file)
index 0000000..3620b2b
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * A general NodeChat class
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 BaseNodeChat extends BaseHubSystem {
+       /**
+        * Protected constructor
+        *
+        * @param       $className      Name of the class
+        * @return      void
+        */
+       protected function __construct ($className) {
+               // Call parent constructor
+               parent::__construct($className);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/chat/console/.htaccess b/application/hub/main/chat/console/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/chat/console/class_NodeConsoleChat.php b/application/hub/main/chat/console/class_NodeConsoleChat.php
new file mode 100644 (file)
index 0000000..c0bf80a
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * A node Console chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 NodeConsoleChat extends BaseNodeChat implements Chatter, Registerable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @return      $chatInstance   An instance of a Chatter class
+        */
+       public final static function createNodeConsoleChat () {
+               // Get new instance
+               $chatInstance = new NodeConsoleChat();
+
+               // Return the prepared instance
+               return $chatInstance;
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/commands/console/class_HubConsoleChatCommand.php b/application/hub/main/commands/console/class_HubConsoleChatCommand.php
new file mode 100644 (file)
index 0000000..8b28528
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/**
+ * A command for the 'chat client' routine
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 HubConsoleChatCommand extends BaseCommand implements Commandable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance       An instance of a command resolver class
+        * @return      $commandInstance        An instance a prepared command class
+        */
+       public static final function createHubConsoleChatCommand (CommandResolver $resolverInstance) {
+               // Get new instance
+               $commandInstance = new HubConsoleChatCommand();
+
+               // Set the application instance
+               $commandInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $commandInstance;
+       }
+
+       /**
+        * Executes the given command 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        Try to create a ChatActivationTask or so
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a registry and the application instance from it
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+               /*
+                * ----------------------- Bootstrapping phase ------------------------
+                * Try to bootstrap the node and pass the request instance to it for
+                * extra arguments which mostly override config entries or enable special
+                * features within the hub (none is ready at this development stage)
+                */
+               $this->debugOutput('BOOTSTRAP: Beginning with bootstrap...');
+               $applicationInstance->getControllerInstance()->executeBootstrapFilters($requestInstance, $responseInstance);
+               $this->debugOutput('BOOTSTRAP: Bootstrap finished.');
+
+               // Get chat instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Add some chat-specific filters
+               $chatInstance->addExtraChatFilters();
+
+               // Get task handler instance
+               $handlerInstance = Registry::getRegistry()->getInstance('task');
+
+               // Debug message
+               $this->debugOutput('MAIN: --- Entering main loop. ---');
+
+               /*
+                * ----------------------------- Main loop ----------------------------
+                * This is the main loop. Queried calls should come back here very fast
+                * so the whole application runs on nice speed. This while-loop goes
+                * until the chat is no longer active or all tasks are killed.
+                */
+               while (($chatInstance->isActive()) && ($handlerInstance->hasTasksLeft())) {
+                       // Handle all tasks here
+                       $handlerInstance->handleTasks();
+               } // END - while
+
+               // Debug message
+               $this->debugOutput('MAIN: --- Leaving main loop. ---');
+       }
+
+       /**
+        * Adds extra filters to the given controller instance
+        *
+        * @param       $controllerInstance             A controller instance
+        * @param       $requestInstance                An instance of a class with an Requestable interface
+        * @return      void
+        * @todo        Should we add some more filters?
+        */
+       public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
+               // Add pre filters
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_php_requirements_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_initializer_filter'));
+               $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('chat_welcome_teaser_filter'));
+
+               // Add bootstrap filters
+               $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_task_handler_initializer_filter'));
+               $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_extra_bootstrapping_filter'));
+
+               // This is the last generic boostrap filter
+               $controllerInstance->addBootstrapFilter(ObjectFactory::createObjectByConfiguredName('chat_bootstrap_generic_activation_filter'));
+
+               // Add shutdown filters
+               //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_task_handler_filter'));
+
+               // This is the last generic shutdown filter
+               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('chat_shutdown_filter'));
+       }
+}
+
+// [EOF]
+?>
index 4885b89935b596cd49d0dab0d073e5ba3a3c4f1d..8cdd1ed8abf47d02357af881317d49445b137ea9 100644 (file)
@@ -124,7 +124,7 @@ class HubConsoleCruncherCommand extends BaseCommand implements Commandable {
                //$controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_task_handler_filter'));
 
                // This is the last generic shutdown filter
-               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_cruncher_filter'));
+               $controllerInstance->addShutdownFilter(ObjectFactory::createObjectByConfiguredName('cruncher_shutdown_filter'));
        }
 }
 
diff --git a/application/hub/main/controller/console/class_HubConsoleChatController.php b/application/hub/main/controller/console/class_HubConsoleChatController.php
new file mode 100644 (file)
index 0000000..db337ff
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+/**
+ * A console controller for the chat program.
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 HubConsoleChatController extends BaseController implements Controller {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Init additional filter chains
+               foreach (array('bootstrap','shutdown') as $filterChain) {
+                       $this->initFilterChain($filterChain);
+               } // END - foreach
+       }
+
+       /**
+        * Creates an instance of this class
+        *
+        * @param       $resolverInstance               An instance of a command resolver class
+        * @return      $controllerInstance             A prepared instance of this class
+        */
+       public static final function createHubConsoleChatController (CommandResolver $resolverInstance) {
+               // Create the instance
+               $controllerInstance = new HubConsoleChatController();
+
+               // Set the command resolver
+               $controllerInstance->setResolverInstance($resolverInstance);
+
+               // Return the prepared instance
+               return $controllerInstance;
+       }
+
+       /**
+        * Handles the given request and response
+        *
+        * @param       $requestInstance        An instance of a request class
+        * @param       $responseInstance       An instance of a response class
+        * @return      void
+        */
+       public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get the command instance from the resolver by sending a request instance to the resolver
+               $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
+
+               // Add more filters by the command
+               $commandInstance->addExtraFilters($this, $requestInstance);
+
+               // Run the pre filters
+               $this->executePreFilters($requestInstance, $responseInstance);
+
+               // This request was valid! :-D
+               $requestInstance->requestIsValid();
+
+               // Execute the command
+               $commandInstance->execute($requestInstance, $responseInstance);
+
+               // Run the pre filters
+               $this->executePostFilters($requestInstance, $responseInstance);
+
+               // Flush the response out
+               $responseInstance->flushBuffer();
+       }
+
+       /**
+        * Add a bootstrap filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addBootstrapFilter (Filterable $filterInstance) {
+               $this->addFilter('bootstrap', $filterInstance);
+       }
+
+       /**
+        * Executes all bootstrap filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeBootstrapFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('bootstrap', $requestInstance, $responseInstance);
+       }
+
+       /**
+        * Add a shutdown filter
+        *
+        * @param       $filterInstance         A Filterable class
+        * @return      void
+        */
+       public function addShutdownFilter (Filterable $filterInstance) {
+               $this->addFilter('shutdown', $filterInstance);
+       }
+
+       /**
+        * Executes all shutdown filters
+        *
+        * @param       $requestInstance        A Requestable class
+        * @param       $responseInstance       A Responseable class
+        * @return      void
+        */
+       public function executeShutdownFilters (Requestable $requestInstance, Responseable $responseInstance) {
+               $this->executeFilters('shutdown', $requestInstance, $responseInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/bootstrap/chat/.htaccess b/application/hub/main/filter/bootstrap/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/filter/bootstrap/chat/class_ChatBootstrap b/application/hub/main/filter/bootstrap/chat/class_ChatBootstrap
new file mode 100644 (file)
index 0000000..494e982
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * A ??? filter for bootstrapping chats
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Chat 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 ChatBootstrap???Filter extends BaseFilter 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 createChatBootstrap???Filter () {
+               // Get a new instance
+               $filterInstance = new ChatBootstrap???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) {
+               // Get chat instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Now do something
+               $this->partialStub('Please implement this step.');
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/bootstrap/chat/class_ChatBootstrapExtraBootstrappingFilter.php b/application/hub/main/filter/bootstrap/chat/class_ChatBootstrapExtraBootstrappingFilter.php
new file mode 100644 (file)
index 0000000..be9bf50
--- /dev/null
@@ -0,0 +1,66 @@
+<?php
+/**
+ * A ExtraBootstrapping filter for bootstrapping chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Chat 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 ChatBootstrapExtraBootstrappingFilter extends BaseFilter 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 createChatBootstrapExtraBootstrappingFilter () {
+               // Get a new instance
+               $filterInstance = new ChatBootstrapExtraBootstrappingFilter();
+
+               // 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 $chatInstance is null (no NullPointerException here)
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get chat instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Do some extra bootstrapping steps
+               $chatInstance->doBootstrapping();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php b/application/hub/main/filter/bootstrap/chat/class_ChatBootstrapGenericActivationFilter.php
new file mode 100644 (file)
index 0000000..a2f03d8
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * A GenericActivation filter for bootstrapping chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 ChatBootstrapGenericActivationFilter extends BaseFilter 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 createChatBootstrapGenericActivationFilter () {
+               // Get a new instance
+               $filterInstance = new ChatBootstrapGenericActivationFilter();
+
+               // 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        Maybe we want to do somthing more here?
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get a chat instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Set the flag
+               $chatInstance->enableIsActive();
+
+               // Debug message
+               $this->debugOutput('BOOTSTRAP: The chat console has been activated.');
+       }
+}
+
+// [EOF]
+?>
index 8f77e8ab7ae0e77c6dc12b7aee21278ae888a21c..e3ef66e849274f4fe28c0c6ebce68c4c3007da00 100644 (file)
@@ -54,8 +54,8 @@ class CruncherBootstrap???Filter extends BaseFilter implements Filterable {
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get node instance
-               $nodeInstance = Registry::getRegistry()->getInstance('node');
+               // Get cruncher instance
+               $cruncherInstance = Registry::getRegistry()->getInstance('cruncher');
 
                // Now do something
                $this->partialStub('Please implement this step.');
diff --git a/application/hub/main/filter/chat/.htaccess b/application/hub/main/filter/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/filter/chat/class_ChatInitializationFilter.php b/application/hub/main/filter/chat/class_ChatInitializationFilter.php
new file mode 100644 (file)
index 0000000..df3ef5b
--- /dev/null
@@ -0,0 +1,75 @@
+<?php
+/**
+ * A Initialization filter for chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 ChatInitializationFilter extends BaseFilter 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 createChatInitializationFilter () {
+               // Get a new instance
+               $filterInstance = new ChatInitializationFilter();
+
+               // 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) {
+               // Get an instance
+               $chatInstance = ObjectFactory::createObjectByConfiguredName('node_console_chat_class');
+
+               // Get a registry
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+               // Set the app instance
+               $chatInstance->setApplicationInstance($applicationInstance);
+
+               // Add chat-specific filters
+               $chatInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
+
+               // Set the chat instance in registry
+               Registry::getRegistry()->addInstance('chat', $chatInstance);
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php b/application/hub/main/filter/chat/class_ChatPhpRequirementsFilter.php
new file mode 100644 (file)
index 0000000..ccd3bdb
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+/**
+ * A PhpRequirements filter for chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 ChatPhpRequirementsFilter extends BaseFilter 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 createChatPhpRequirementsFilter () {
+               // Get a new instance
+               $filterInstance = new ChatPhpRequirementsFilter();
+
+               // 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;
+
+               // Socket support is essential...
+               if (!function_exists('socket_create')) {
+                       // Test failed
+                       $checkPassed = false;
+                       $checksFailed++;
+               } // END -if
+
+               // Are all tests passed?
+               if ($checkPassed === false) {
+                       // Throw an exception
+                       throw new FilterChainException($this, self::FILTER_CHAIN_INTERCEPTED);
+               } // END - if
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/chat/class_ChatWelcomeTeaserFilter.php b/application/hub/main/filter/chat/class_ChatWelcomeTeaserFilter.php
new file mode 100644 (file)
index 0000000..65dcd50
--- /dev/null
@@ -0,0 +1,67 @@
+<?php
+/**
+ * A welcome-teaser filter for the chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 ChatWelcomeTeaserFilter extends BaseFilter 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 createChatWelcomeTeaserFilter () {
+               // Get a new instance
+               $filterInstance = new ChatWelcomeTeaserFilter();
+
+               // 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 $nodeInstance is null (no NullPointerException here)
+        * @todo        Handle over the $responseInstance to outputConsoleTeaser()
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get node instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Now output the teaser
+               $chatInstance->outputConsoleTeaser();
+       }
+}
+
+// [EOF]
+?>
index 77b7bb05414c26b12de75b4b703e120198c9bee2..52b2a3537e563c8a8377517efb9cde297f25cd01 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * A welcome-teaser filter for the console
+ * A welcome-teaser filter for the cruncher
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -52,7 +52,7 @@ class CruncherWelcomeTeaserFilter extends BaseFilter implements Filterable {
         * @param       $responseInstance       An instance of a class with an Responseable interface
         * @return      void
         * @throws      FilterChainException    If $nodeInstance is null (no NullPointerException here)
-        * @todo        Handle over the $responseInstance to outputCruncherTeaser()
+        * @todo        Handle over the $responseInstance to outputConsoleTeaser()
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get node instance
diff --git a/application/hub/main/filter/shutdown/chat/.htaccess b/application/hub/main/filter/shutdown/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/filter/shutdown/chat/class_ChatShutdownFilter.php b/application/hub/main/filter/shutdown/chat/class_ChatShutdownFilter.php
new file mode 100644 (file)
index 0000000..6d90d49
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * A shutdown filter for shutting down the chat console. This filter should be
+ * the last one in 'shutdown' chain so the hub is shutted down at the very end
+ * of its life...
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 ChatShutdownFilter extends BaseFilter 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 createChatShutdownFilter () {
+               // Get a new instance
+               $filterInstance = new ChatShutdownFilter();
+
+               // 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 $nodeInstance is null (no NullPointerException please)
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get node instance
+               $chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Shutdown the chat. This should be the last line
+               $chatInstance->doShutdown();
+       }
+}
+
+// [EOF]
+?>
index 14022f818b0fc5a6b56b9a970ab80bcdc040cbb7..f551ef47b7591c74e7b59193e56a1fa6505a87ab 100644 (file)
@@ -1,68 +1,3 @@
 <?php
-/**
- * A ShutdownCruncher filter for shutting down the cruncher. 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 cruncher...
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 CruncherShutdownCruncherFilter extends BaseFilter 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 createCruncherShutdownCruncherFilter () {
-               // Get a new instance
-               $filterInstance = new CruncherShutdownCruncherFilter();
-
-               // 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 $nodeInstance is null (no NullPointerException please)
-        */
-       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               // Get node instance
-               $cruncherInstance = Registry::getRegistry()->getInstance('cruncher');
-
-               // Shutdown the cruncher. This should be the last line
-               $cruncherInstance->doShutdown();
-       }
-}
-
-// [EOF]
+// @DEPRECATED
 ?>
diff --git a/application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownFilter.php b/application/hub/main/filter/shutdown/cruncher/class_CruncherShutdownFilter.php
new file mode 100644 (file)
index 0000000..e92c30d
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * A shutdown filter for shutting down the cruncher. 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 cruncher...
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 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 CruncherShutdownFilter extends BaseFilter 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 createCruncherShutdownFilter () {
+               // Get a new instance
+               $filterInstance = new CruncherShutdownFilter();
+
+               // 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 $nodeInstance is null (no NullPointerException please)
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get node instance
+               $cruncherInstance = Registry::getRegistry()->getInstance('cruncher');
+
+               // Shutdown the cruncher. This should be the last line
+               $cruncherInstance->doShutdown();
+       }
+}
+
+// [EOF]
+?>
diff --git a/application/hub/main/filter/task/chat/.htaccess b/application/hub/main/filter/task/chat/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/hub/main/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php b/application/hub/main/filter/task/chat/class_ChatTaskHandlerInitializerFilter.php
new file mode 100644 (file)
index 0000000..5d984d7
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * A TaskHandlerInitializer filter for chat
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 chat 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 ChatTaskHandlerInitializerFilter extends BaseFilter 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 createChatTaskHandlerInitializerFilter () {
+               // Get a new instance
+               $filterInstance = new ChatTaskHandlerInitializerFilter();
+
+               // 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 we need to interrupt the filter chain
+        * @todo        5% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Get chat instance
+               //$chatInstance = Registry::getRegistry()->getInstance('chat');
+
+               // Get a new task handler instance
+               $handlerInstance = ObjectFactory::createObjectByConfiguredName('task_handler_class');
+
+               // Register all tasks:
+               //
+               // 1) A task for fetching WUs (work units) or test units
+               //$taskInstance = ObjectFactory::createObjectByConfiguredName('chat_work_unit_fetcher_task_class');
+               //$handlerInstance->registerTask('chat_work_unit_fetcher', $taskInstance);
+
+               // Put the task handler in registry
+               Registry::getRegistry()->addInstance('task', $handlerInstance);
+       }
+}
+
+// [EOF]
+?>