From df1b3a826bc67c252efaaac93cb8e78b2cb29603 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 10 Jun 2015 20:10:41 +0200 Subject: [PATCH 1/1] Added accept() and doShutdown() to Taskable as this will always be needed. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/classes/interfaces/tasks/class_Taskable.php | 15 +++++++++++++++ inc/classes/main/tasks/class_ | 10 ++++++++++ .../main/tasks/idle/class_IdleLoopTask.php | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/inc/classes/interfaces/tasks/class_Taskable.php b/inc/classes/interfaces/tasks/class_Taskable.php index 9ec1a711..b1915b92 100644 --- a/inc/classes/interfaces/tasks/class_Taskable.php +++ b/inc/classes/interfaces/tasks/class_Taskable.php @@ -22,12 +22,27 @@ * along with this program. If not, see . */ interface Taskable extends FrameworkInterface { + /** + * Accepts the visitor to process the visitor + * + * @param $visitorInstance An instance of a Visitor class + * @return void + */ + function accept (Visitor $visitorInstance); + /** * Executes the task * * @return void */ function executeTask (); + + /** + * Shuts down the task + * + * @return void + */ + function doShutdown (); } // [EOF] diff --git a/inc/classes/main/tasks/class_ b/inc/classes/main/tasks/class_ index daacdebd..1bbb87e2 100644 --- a/inc/classes/main/tasks/class_ +++ b/inc/classes/main/tasks/class_ @@ -66,6 +66,16 @@ class !!!???Task extends BaseTask implements Taskable, Visitable { 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/inc/classes/main/tasks/idle/class_IdleLoopTask.php b/inc/classes/main/tasks/idle/class_IdleLoopTask.php index f07b0e89..0dd2de9f 100644 --- a/inc/classes/main/tasks/idle/class_IdleLoopTask.php +++ b/inc/classes/main/tasks/idle/class_IdleLoopTask.php @@ -73,7 +73,7 @@ class IdleLoopTask extends BaseTask implements Taskable, Visitable { */ public function doShutdown () { // Debug message - self::createDebugInstance(__CLASS__)->debugOutput('IDLE-TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); + self::createDebugInstance(__CLASS__)->debugOutput('TASK[' . __METHOD__ . ':' . __LINE__ . ']: Shutting down...'); } } -- 2.39.2