當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cron::MailFetcher方法代碼示例

本文整理匯總了PHP中Cron::MailFetcher方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cron::MailFetcher方法的具體用法?PHP Cron::MailFetcher怎麽用?PHP Cron::MailFetcher使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cron的用法示例。


在下文中一共展示了Cron::MailFetcher方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 function run()
 {
     //called by outside cron NOT autocron
     Cron::MailFetcher();
     Cron::TicketMonitor();
     cron::PurgeLogs();
 }
開發者ID:supaket,項目名稱:helpdesk,代碼行數:7,代碼來源:class.cron.php

示例2: ob_end_clean

if ($sec < 180 || !$ost || $ost->isUpgradePending())
    ob_end_clean();

require_once(INCLUDE_DIR.'class.cron.php');

// Clear staff obj to avoid false credit internal notes & auto-assignment
$thisstaff = null;

// Release the session to prevent locking a future request while this is
// running
$_SESSION['lastcroncall'] = time();
session_write_close();

// Age tickets: We're going to age tickets regardless of cron settings.
Cron::TicketMonitor();

// Run file purging about every 20 cron runs (1h40 on a five minute cron)
if (mt_rand(1, 20) == 4)
    Cron::CleanOrphanedFiles();

if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enabled!
    Cron::MailFetcher();  //Fetch mail.
    $ost->logDebug(_S('Auto Cron'), sprintf(_S('Mail fetcher cron call [%s]'), $caller));
}

$data = array('autocron'=>true);
Signal::send('cron', $data);

ob_end_clean();
?>
開發者ID:KingsleyGU,項目名稱:osticket,代碼行數:30,代碼來源:autocron.php

示例3: while

print $data;
// Flush the request buffer
while (@ob_end_flush()) {
}
flush();
//Terminate the request
if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
}
ob_start();
//Keep the image output clean. Hide our dirt.
//TODO: Make cron DB based to allow for better time limits. Direct calls for now sucks big time.
//We DON'T want to spawn cron on every page load...we record the lastcroncall on the session per user
$sec = time() - $_SESSION['lastcroncall'];
$caller = $thisstaff->getUserName();
if ($sec > 180 && $ost && !$ost->isUpgradePending()) {
    //user can call cron once every 3 minutes.
    require_once INCLUDE_DIR . 'class.cron.php';
    $thisstaff = null;
    //Clear staff obj to avoid false credit internal notes & auto-assignment
    Cron::TicketMonitor();
    //Age tickets: We're going to age tickets regardless of cron settings.
    if ($cfg && $cfg->isAutoCronEnabled()) {
        //ONLY fetch tickets if autocron is enabled!
        Cron::MailFetcher();
        //Fetch mail.
        $ost->logDebug('Auto Cron', 'Mail fetcher cron call [' . $caller . ']');
    }
    $_SESSION['lastcroncall'] = time();
}
ob_end_clean();
開發者ID:ed00m,項目名稱:osTicket-1.8,代碼行數:31,代碼來源:autocron.php


注:本文中的Cron::MailFetcher方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。