22 $json =
new stdClass();
24 $json->status =
"fail";
42 $json =
new stdClass();
44 $json->status =
"block";
45 $json->task_id = $a_task_id;
66 $json =
new stdClass();
69 $json->task_id = $a_task_id;
73 $json->steps = (int)$a_steps;
88 $json =
new stdClass();
97 $json->result_cmd = $a_finished_cmd;
98 $json->result = $a_finished_result;
114 $json =
new stdClass();
116 $json->status =
"finished";
117 $json->task_id = $a_task_id;
118 $json->result_cmd = $a_cmd;
119 $json->result = $a_result;
132 if(!is_string($a_text))
137 $a_text = htmlentities($a_text, ENT_COMPAT | ENT_HTML401,
"UTF-8");
138 $a_text = str_replace(
"'",
"'", $a_text);
An exception for terminatinating execution or to throw for unit testing.
Background task JSON helper.
static jsonSafeString($a_text)
Makes the specified string safe for JSON.
static getFailedJson($a_message)
Get json for failed task.
static getProcessingJson($a_task_id, $a_message, $a_steps)
Get json for processing task.
static getProgressJson(ilBackgroundTask $a_task, $a_finished_cmd=null, $a_finished_result=null)
Get json for task progress.
static getFinishedJson($a_task_id, $a_cmd, $a_result)
Get json for finished task.
static getBlockedJson($a_task_id)
Get json for blocked task.
getSteps()
Gets the steps.
getStatus()
Gets the status.
getCurrentStep()
Gets the current step.