webCOMAND

SystemTask::log_status()

Updates the status field of the task object with the given text, which is displayed in the webCOMAND Notifications & Tasks sidebar, and CLI daemon status output.

Prototype

void log_status(string $status)

Parameters

  • status - The new status message.

Example

/**
 * "Runnable" class to define a background System Task that just
 * waits 30 seconds, updating the status when started and finished.
 */
use io_comand_systemtask\models\SystemTask;
use io_comand_systemtask\runnable;

class wait_thirty extends runnable {
    public function run(SystemTask $task, array $params = []) {
        $task->log_status('Waiting 30 seconds...');
        sleep(30);
        $task->log_status('Finished.');
    }
}