コード例 #1
0
ファイル: cron_class.php プロジェクト: notzen/e107
 function procEmailQueue()
 {
     //global $pref;
     if (CRON_MAIL_DEBUG) {
         $e107 = e107::getInstance();
         $e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Email', 'Email run started', FALSE, LOG_TO_ROLLING);
     }
     require_once e_HANDLER . 'mail_manager_class.php';
     $mailManager = new e107MailManager();
     $mailManager->doEmailTask(varset($pref['mail_workpertick'], 5));
     if (CRON_MAIL_DEBUG) {
         $e107->admin_log->e_log_event(10, debug_backtrace(), 'DEBUG', 'CRON Email', 'Email run completed', FALSE, LOG_TO_ROLLING);
     }
 }
コード例 #2
0
ファイル: mailout.php プロジェクト: armpit/e107
/**
 * Display Progress-bar of real-time mail-out. 
 * @return 
 */
function sendProgress($id)
{
    //	return rand(92,100);
    $pref = e107::getPref();
    ob_start();
    $perAjaxHit = e107::getConfig()->get('mail_pause', 1);
    $mailManager = new e107MailManager();
    $mailManager->doEmailTask($perAjaxHit);
    $sqld = e107::getDb('progress');
    $sqld->select("mail_content", "mail_total_count,mail_togo_count,mail_sent_count,mail_fail_count", "mail_source_id= " . intval($id));
    $row = $sqld->fetch();
    $rand = $row['mail_sent_count'] + $row['mail_fail_count'];
    $total = $row['mail_total_count'];
    $errors = ob_get_clean();
    $errors .= " id=" . $id;
    e107::getMessage()->addDebug($errors);
    $inc = round($rand / $total * 100);
    $errors .= " inc=" . $inc;
    file_put_contents(e_LOG . 'send-mail-progress.txt', $errors);
    e107::getMessage()->addDebug("Returned: " . $inc);
    return $inc;
}
コード例 #3
0
ファイル: mailout.php プロジェクト: notzen/e107
require_once e_HANDLER . 'mailout_admin_class.php';
// Admin tasks handler
require_once e_HANDLER . 'mail_manager_class.php';
// Mail DB API
require_once e_HANDLER . 'message_handler.php';
$emessage =& eMessage::getInstance();
if ($_GET['mode'] == "process") {
    session_write_close();
    // allow other scripts to run in parallel.
    header('Content-Encoding: none');
    ignore_user_abort(true);
    set_time_limit(0);
    header("Content-Length: {$size}");
    header('Connection: close');
    $mailManager = new e107MailManager();
    $mailManager->doEmailTask(999999);
    echo "Completed Mailout ID: " . $_GET['id'];
    exit;
}
$action = $e107->tp->toDB(varset($_GET['mode'], 'makemail'));
$pageMode = varset($_GET['savepage'], $action);
// Sometimes we need to know what brought us here - $action gets changed
$mailId = intval(varset($_GET['m'], 0));
$targetId = intval(varset($_GET['t'], 0));
// Create mail admin object, load all mail handlers
$mailAdmin = new mailoutAdminClass($action);
// This decodes parts of the query using $_GET syntax
e107::setRegistry('_mailout_admin', $mailAdmin);
if ($mailAdmin->loadMailHandlers() == 0) {
    // No mail handlers loaded
    echo 'No mail handlers loaded!!';