Exemple #1
0
}
doAction('cron_1');
if (SYSTEM_PAGE == 'runcron') {
    $cron = isset($_GET['cron']) ? sqladds(strip_tags($_GET['cron'])) : msg('运行失败:计划任务未指定');
    $cpw = option::get('cron_pw');
    $x = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "cron` WHERE `name` = '{$cron}';");
    if (empty($x['id'])) {
        msg('运行失败:此计划任务不存在');
    }
    $log = cron::run($x['file'], $x['name']);
    if ($x['freq'] == '-1') {
        cron::del($x['name']);
    } else {
        cron::aset($x['name'], array('lastdo' => time(), 'log' => $log));
    }
} else {
    $sign_multith = option::get('sign_multith');
    if (!isset($_GET['donnot_sign_multith']) && !empty($sign_multith) && function_exists('fsockopen')) {
        for ($ii = 0; $ii < $sign_multith; $ii++) {
            sendRequest(SYSTEM_URL . 'do.php?donnot_sign_multith&in_thread&pw=' . $cron_pw);
        }
    }
    $return = '';
    if (option::get('cron_last_do_time') != $today) {
        option::set('cron_last_do_time', $today);
        option::set('cron_last_do', '0');
    }
    cron::runall();
}
doAction('cron_2');
msg('本次计划任务完成', false, false);