API/PHP/Job

From CLAWSWiki

Jump to: navigation, search

Claws can track Jobs and Runs. A Job is some kind of task which might happen multiple times, and a Run is an individual instance of that Job. An example of a Job might be "Expire Accounts." There is only one "Expire Accounts" Job, and once a day when it runs a new Run is created for that particular execution.

Example Code

$r = new Run($claws);
$r->setParam("Job", "Test Job");
$r->getParam('Host')->get()->setParam( 'Username', 'wck1234' ) );
$r->start();
//Run things as usual
new Command($claws, "VERSION", true)->execute();
$r->finish(0); //Exit code