Ejemplo n.º 1
0
 public function testGetOptions()
 {
     $out = new ezcConsoleOutput();
     $status = new ezcConsoleProgressMonitor($out, 7);
     $this->assertSame($status->options, $status->getOptions());
 }
 $itemsNotSend = $sendItemsStatistic['items_not_send'];
 // ### sendObject Data
 $outputFormatStringArray = $sendObject->getParsedOutputXml();
 // embed images
 foreach ($outputFormatStringArray as $outputFormatId => $outputFormatNewsletterContentArray) {
     if ($outputFormatNewsletterContentArray['html_mail_image_include'] == 1) {
         $outputFormatStringArray[$outputFormatId] = CjwNewsletterEdition::prepareImageInclude($outputFormatNewsletterContentArray);
     }
 }
 // embed images ends
 $emailSender = $sendObject->attribute('email_sender');
 $emailSenderName = $sendObject->attribute('email_sender_name');
 $limit = 50;
 $offset = 0;
 $itemCounter = 1;
 $progressMonitor = new ezcConsoleProgressMonitor($output, $itemsNotSend);
 $cjwMail = new CjwNewsletterMail();
 $cjwMail->setTransportMethodCronjobFromIni();
 // process every send_item of current sendobject
 for ($i = 0; $i < $itemsNotSend; $i += $limit) {
     //  $progressBar->advance();
     $sendItemList = CjwNewsletterEditionSendItem::fetchListSendIdAndStatus($editionSendId, CjwNewsletterEditionSendItem::STATUS_NEW, $limit, $offset);
     $count = count($sendItemList);
     foreach ($sendItemList as $sendItem) {
         $id = $sendItem->attribute('id');
         $outputFormatId = $sendItem->attribute('output_format_id');
         // ### get newsletter user data through send_item_object
         $newsletterUserObject = $sendItem->attribute('newsletter_user_object');
         $emailReceiver = $newsletterUserObject->attribute('email');
         $emailReceiverName = $newsletterUserObject->attribute('email_name');
         // fetch html & text content of parsed outputxml from senmdobject
Ejemplo n.º 3
0
 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
 * @license http://ez.no/licenses/new_bsd New BSD License
 */
require_once 'Base/src/base.php';
/**
 * Autoload ezc classes 
 * 
 * @param string $className 
 */
function __autoload($className)
{
    ezcBase::autoload($className);
}
$out = new ezcConsoleOutput();
// Create a progress monitor
$status = new ezcConsoleProgressMonitor($out, 7);
// Perform actions
$i = 0;
while ($i++ < 7) {
    // Do whatever you want to indicate progress for
    usleep(mt_rand(20000, 2000000));
    // Advance the statusbar by one step
    $status->addEntry('ACTION', "Performed action #{$i}.");
}
$out->outputLine();
/*
OUTPUT:
    14.3% ACTION Performed action #1.
    28.6% ACTION Performed action #2.
    42.9% ACTION Performed action #3.
    57.1% ACTION Performed action #4.
 // embed images
 foreach ($outputFormatStringArray as $outputFormatId => $outputFormatNewsletterContentArray) {
     if ($outputFormatNewsletterContentArray['html_mail_image_include'] == 1) {
         $outputFormatStringArray[$outputFormatId] = CjwNewsletterEdition::prepareImageInclude($outputFormatNewsletterContentArray);
     }
 }
 // embed images ends
 $emailSender = $sendObject->attribute('email_sender');
 $emailSenderName = $sendObject->attribute('email_sender_name');
 $personalizeContent = (int) $sendObject->attribute('personalize_content');
 $emailReplyTo = $sendObject->attribute('email_reply_to');
 $emailReturnPath = $sendObject->attribute('email_return_path');
 $limit = 50;
 $offset = 0;
 $itemCounter = 1;
 $progressMonitor = new ezcConsoleProgressMonitor($output, $itemsNotSend);
 $cjwMail = new CjwNewsletterMail();
 $cjwMail->setTransportMethodCronjobFromIni();
 // process every send_item of current sendobject
 for ($i = 0; $i < $itemsNotSend; $i += $limit) {
     //  $progressBar->advance();
     $sendItemList = CjwNewsletterEditionSendItem::fetchListSendIdAndStatus($editionSendId, CjwNewsletterEditionSendItem::STATUS_NEW, $limit, $offset);
     $count = count($sendItemList);
     foreach ($sendItemList as $sendItem) {
         $id = $sendItem->attribute('id');
         $outputFormatId = $sendItem->attribute('output_format_id');
         // ### subscription data
         $newsletterSubscriptionObject = $sendItem->attribute('newsletter_subscription_object');
         if (is_object($newsletterSubscriptionObject)) {
             $newsletterUnsubscribeHash = $newsletterSubscriptionObject->attribute('hash');
             // ### get newsletter user data through send_item_object