예제 #1
0
function ClineError($msg)
{
    ob_end_clean();
    print ClineSignature();
    print "\nError: {$msg}\n";
    exit;
}
예제 #2
0
    if (!empty($_GET['secret'])) {
        if (isset($_GET['ack']) && $_GET['ack'] == 1) {
            @ob_end_clean();
            print 'ACK';
            exit;
        }
        include dirname(__FILE__) . '/actions/processqueue.php';
        return;
    }
    if (!MANUALLY_PROCESS_QUEUE) {
        print "This page can only be called from the commandline";
        return;
    }
} else {
    @ob_end_clean();
    print ClineSignature();
    ob_start();
    include dirname(__FILE__) . '/actions/processqueue.php';
    return;
}
# once and for all get rid of those questions why they do not receive any emails :-)
if (TEST) {
    print Info('<strong>' . $GLOBALS['I18N']->get('Running in testmode, no emails will be sent. Check your config file.'), 1) . '</strong>';
}
print '<noscript>
<div class="error">' . s('This page requires Javascript to be enabled.') . '</div>
</noscript>';
if (isset($_GET['pqchoice'])) {
    if ($_GET['pqchoice'] == 'local') {
        SaveConfig('pqchoice', 'local', 0);
    } elseif ($_GET['pqchoice'] == 'reset') {
예제 #3
0
파일: cron.php 프로젝트: MarcelvC/phplist3
require_once dirname(__FILE__) . '/accesscheck.php';
/*
 * 
 * page to handle any cron-related activity. Instead of having multiple cron entries, this
 * one page should be called to do the tasks. It should be called as often as possible, eg once every 5 minutes
 * or even once a minute.
 * 
 * For now, the configuration is manually, there is no UI for it yet. Plugins can register their own cron activities.
 * TODO, work with eg https://github.com/mtdowling/cron-expression
 * 
 */
if (!$GLOBALS['commandline']) {
    print 'This page can only be called from the commandline';
    return;
}
cl_output(ClineSignature());
$cronJobs = array();
foreach ($GLOBALS['plugins'] as $pluginname => $plugin) {
    $pluginJobs = $plugin->cronJobs();
    # cl_output($pluginname.' has '.sizeof($pluginJobs).' jobs');
    foreach ($pluginJobs as $job) {
        $cronJobs[] = array('plugin' => $pluginname, 'page' => $job['page'], 'frequency' => $job['frequency']);
    }
}
if (!count($cronJobs)) {
    cl_output(s('Nothing to do'));
    exit;
}
$maxNextRun = 0;
$now = time();
foreach ($cronJobs as $cronJob) {