Beispiel #1
0
    //endif enddateiem
    $validTimes = getTimes($schedule_record);
    if (is_array($validTimes) && in_array($now, $validTimes)) {
        switch ($schedule_record["type"]) {
            case "job":
                $success = @(include $schedule_record["job"]);
                break;
            case "pushrecord":
                include_once "../../modules/api/include/push.php";
                //try to include table specific functions
                $tableFile = "../../modules/" . $schedule_record["modulename"] . "/include/" . $schedule_record["maintable"] . ".php";
                if (file_exists($tableFile)) {
                    include_once $tableFile;
                }
                $push = new push($db, $schedule_record["pushrecordid"]);
                $success = $push->process();
                break;
        }
        //end switch
        if ($success) {
            $updatestatement = "UPDATE scheduler SET lastrun=NOW() WHERE id=" . $schedule_record["id"];
            $db->query($updatestatement);
            $log = new phpbmsLog("Scheduled Job " . $schedule_record["name"] . " (" . $schedule_record["id"] . ") completed", "SCHEDULER", "usr:42e0cc76-3c31-d9b6-ff12-fe4adfd15e75");
        } else {
            $log = new phpbmsLog("Scheduled Job " . $schedule_record["name"] . " (" . $schedule_record["id"] . ") returned errors", "SCHEDULER", "usr:42e0cc76-3c31-d9b6-ff12-fe4adfd15e75");
        }
        //endif success
    }
    //endif is_array();
}
//endwhile
Beispiel #2
0
 function runPush($pushRecordUuid)
 {
     include_once "modules/api/include/push.php";
     $uuidArray = getUuidArray($this->db, $this->tabledefuuid, $this->idsArray);
     if ($uuidArray === false) {
         $uuidArray = array();
     }
     $push = new push($this->db, $pushRecordUuid, $uuidArray);
     $thereturn = $push->process();
     if ($thereturn !== false) {
         $message = count($push->uuidArray) . " record(s) pushed.";
     } else {
         $message = "An error has occured.";
     }
     return $message;
 }