コード例 #1
0
    $Q = $QUEUE->getQ($q_id);
    $logfilename = "q_.log.html";
    if (isset($Q[0]['id'])) {
        $logfilename = "q_" . $Q[0]['id'] . "_" . $Q[0]['grp_id'] . "_" . date_convert_to_string($Q[0]['created']) . ".log.html";
    }
}
/* Actions */
//stop queue
if ($set == "stop" && $doit == 1 && check_dbid($q_id)) {
    $QUEUE->setStatus($q_id, 5);
    $LOG = "[" . microtime(TRUE) . "][0]," . date("Y-m-d H:i:s") . ",q:" . $q_id . ",n:0,g:0,a:0,t: Q ID {$q_id} halted\n";
    update_file($tm_logpath, $logfilename, $LOG);
}
//restart queue with failed or canceled/skipped records
if ($set == "restart_failed" && $doit == 1 && check_dbid($q_id)) {
    $QUEUE->restart_failed($q_id);
    $QUEUE->setStatus($q_id, 1);
}
//continue stopped queue
if ($set == "continue" && $doit == 1 && check_dbid($q_id)) {
    $QUEUE->setStatus($q_id, 2);
    $LOG = "[" . microtime(TRUE) . "][0]," . date("Y-m-d H:i:s") . ",q:" . $q_id . ",n:0,g:0,a:0,t: Q ID {$q_id} continues\n";
    update_file($tm_logpath, $logfilename, $LOG);
}
//delete, delete all
if (($set == "delete" || $set == "delete_all") && $doit == 1 && check_dbid($q_id)) {
    //nl auf status queued setzen =2
    //Q holen
    $Q = $QUEUE->getQ($q_id);
    if (isset($Q[0]['id'])) {
        //und q fuer newsletter aus aktueller q holen