From: Roland Häder Date: Sun, 29 May 2011 02:36:36 +0000 (+0000) Subject: Added missing interface X-Git-Url: https://git.mxchange.org/?p=hub.git;a=commitdiff_plain;h=502ec0ce71bed01c7932df010a079378823d8e28 Added missing interface --- diff --git a/application/hub/interfaces/chat/class_Chatter.php b/application/hub/interfaces/chat/class_Chatter.php index f92865e77..ee00bc1d8 100644 --- a/application/hub/interfaces/chat/class_Chatter.php +++ b/application/hub/interfaces/chat/class_Chatter.php @@ -1,12 +1,13 @@ * @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 + * @todo We need to find a better name for this interface * * 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 @@ -22,6 +23,46 @@ * along with this program. If not, see . */ interface Chatter extends FrameworkInterface { + /** + * Method to "bootstrap" the chatter. This step does also apply provided + * command-line arguments stored in the request instance. You should now + * get it from calling $this->getRequestInstance(). + * + * @return void + */ + function doBootstrapping (); + + /** + * Outputs the console teaser. This should only be executed on startup or + * full restarts. This method generates some space around the teaser. + * + * @return void + */ + function outputConsoleTeaser (); + + /** + * Add some chatter-specific filters + * + * @param $controllerInstance An object of a Controller instance + * @param $responseInstance An object of a Responseable instance + * @return void + */ + function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance); + + /** + * Enables/disables the chatter (just sets a flag) + * + * @param $version Version number of this chatter + * @return void + */ + function enableIsActive ($isActive = true); + + /** + * Determines wether the chatter is active + * + * @return $isActive Wether the chatter is active + */ + function isActive (); } // [EOF] diff --git a/application/hub/interfaces/cruncher/class_CruncherHelper.php b/application/hub/interfaces/cruncher/class_CruncherHelper.php index 68b791d11..b5fafe4f7 100644 --- a/application/hub/interfaces/cruncher/class_CruncherHelper.php +++ b/application/hub/interfaces/cruncher/class_CruncherHelper.php @@ -24,7 +24,7 @@ */ interface CruncherHelper extends FrameworkInterface { /** - * Method to "bootstrap" the node. This step does also apply provided + * Method to "bootstrap" the cruncher. This step does also apply provided * command-line arguments stored in the request instance. You should now * get it from calling $this->getRequestInstance(). * diff --git a/application/hub/main/chat/class_ b/application/hub/main/chat/class_ index 7d7325b7d..960e53d4f 100644 --- a/application/hub/main/chat/class_ +++ b/application/hub/main/chat/class_ @@ -44,6 +44,38 @@ class Node???Chat extends BaseNodeChat implements Chatter { // Return the prepared instance return $chatInstance; } + + /** + * Method to "bootstrap" the chatter. This step does also apply provided + * command-line arguments stored in the request instance. You should now + * get it from calling $this->getRequestInstance(). + * + * @return void + */ + public function doBootstrapping () { + $this->partialStub('Please implement this method.'); + } + + /** + * Outputs the console teaser. This should only be executed on startup or + * full restarts. This method generates some space around the teaser. + * + * @return void + */ + public function outputConsoleTeaser () { + $this->partialStub('Please implement this method.'); + } + + /** + * Add some chatter-specific filters + * + * @param $controllerInstance An object of a Controller instance + * @param $responseInstance An object of a Responseable instance + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) { + $this->partialStub('Please implement this method.'); + } } // [EOF] diff --git a/application/hub/main/chat/class_BaseNodeChat.php b/application/hub/main/chat/class_BaseNodeChat.php index 3620b2b3a..99d47ba0b 100644 --- a/application/hub/main/chat/class_BaseNodeChat.php +++ b/application/hub/main/chat/class_BaseNodeChat.php @@ -22,6 +22,11 @@ * along with this program. If not, see . */ class BaseNodeChat extends BaseHubSystem { + /** + * Wether this Chatter is active + */ + private $isActive = false; + /** * Protected constructor * @@ -32,6 +37,25 @@ class BaseNodeChat extends BaseHubSystem { // Call parent constructor parent::__construct($className); } + + /** + * Enables/disables the chatter (just sets a flag) + * + * @param $version Version number of this chatter + * @return void + */ + public final function enableIsActive ($isActive = true) { + $this->isActive = (bool) $isActive; + } + + /** + * Determines wether the chatter is active + * + * @return $isActive Wether the chatter is active + */ + public final function isActive () { + return $this->isActive; + } } // [EOF] diff --git a/application/hub/main/chat/console/class_NodeConsoleChat.php b/application/hub/main/chat/console/class_NodeConsoleChat.php index c0bf80a4e..46bb5b742 100644 --- a/application/hub/main/chat/console/class_NodeConsoleChat.php +++ b/application/hub/main/chat/console/class_NodeConsoleChat.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -44,6 +44,38 @@ class NodeConsoleChat extends BaseNodeChat implements Chatter, Registerable { // Return the prepared instance return $chatInstance; } + + /** + * Method to "bootstrap" the chatter. This step does also apply provided + * command-line arguments stored in the request instance. You should now + * get it from calling $this->getRequestInstance(). + * + * @return void + */ + public function doBootstrapping () { + $this->partialStub('Please implement this method.'); + } + + /** + * Outputs the console teaser. This should only be executed on startup or + * full restarts. This method generates some space around the teaser. + * + * @return void + */ + public function outputConsoleTeaser () { + $this->partialStub('Please implement this method.'); + } + + /** + * Add some chatter-specific filters + * + * @param $controllerInstance An object of a Controller instance + * @param $responseInstance An object of a Responseable instance + * @return void + */ + public function addExtraFilters (Controller $controllerInstance, Responseable $responseInstance) { + $this->partialStub('Please implement this method.'); + } } // [EOF] diff --git a/application/hub/main/source/units/class_TestUnitSource.php b/application/hub/main/source/units/class_TestUnitSource.php index 0de4ac22b..f100c13f1 100644 --- a/application/hub/main/source/units/class_TestUnitSource.php +++ b/application/hub/main/source/units/class_TestUnitSource.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class TestUnitSource extends BaseSource implements Sourceable { +class TestUnitSource extends BaseSource implements Sourceable, Registerable { /** * Protected constructor *