X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Fhandler%2Ftasks%2Fclass_TaskHandler.php;h=6ae9398c3b560248cd9ab79c3f06355cdb3c510e;hp=b52d3bd386825db688bb66970a7ebbe0bd36c16a;hb=f57dd51863ec9baacba447d76b46d5c709b9b02e;hpb=78a010fef84895720e796842208f01dfb619c332 diff --git a/framework/main/classes/handler/tasks/class_TaskHandler.php b/framework/main/classes/handler/tasks/class_TaskHandler.php index b52d3bd3..6ae9398c 100644 --- a/framework/main/classes/handler/tasks/class_TaskHandler.php +++ b/framework/main/classes/handler/tasks/class_TaskHandler.php @@ -1,17 +1,21 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2019 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -87,7 +91,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { */ private function executeCurrentTask () { // Update no task by default - $updateTask = FALSE; + $updateTask = false; // Is the current task valid? if (!$this->getListInstance()->getIterator()->valid()) { @@ -99,7 +103,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { $currentTask = $this->getListInstance()->getIterator()->current(); // Is the task not yet started? - if ($currentTask['task_started'] === FALSE) { + if ($currentTask['task_started'] === false) { // Determine difference between current time and registration $diff = ($this->getMilliTime() - $currentTask['task_registered']) * 1000; @@ -111,8 +115,8 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { } // END - if // Launch the task and mark it as updated - $currentTask['task_started'] = TRUE; - $updateTask = TRUE; + $currentTask['task_started'] = true; + $updateTask = true; // Debug message self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms'); @@ -127,7 +131,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Is the interval delay reached? if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) { // Should we update the task from startup? - if ($updateTask === TRUE) { + if ($updateTask === true) { // Update the task before leaving $this->updateTask($currentTask); } // END - if @@ -217,7 +221,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { * Registers a task with a task handler. * * @param $taskName A task name to register the task on - * @param $taskInstance The instance we should register as a task + * @param $taskInstance The instance that should be registered as a task * @return void */ public function registerTask ($taskName, Visitable $taskInstance) { @@ -235,11 +239,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask { // Identifier for the generateHash() method 'id' => $taskName, // Whether the task is started - 'task_started' => FALSE, + 'task_started' => false, // Whether the task is paused (not yet implemented) - 'task_paused' => FALSE, + 'task_paused' => false, // Whether the task can be paused (not yet implemented) - 'task_pauseable' => TRUE, + 'task_pauseable' => true, // Timestamp of registration 'task_registered' => $this->getMilliTime(), // Last activity timestamp