当前位置: 首页>>代码示例>>PHP>>正文


PHP WYSIJA::croned_weekly方法代码示例

本文整理汇总了PHP中WYSIJA::croned_weekly方法的典型用法代码示例。如果您正苦于以下问题:PHP WYSIJA::croned_weekly方法的具体用法?PHP WYSIJA::croned_weekly怎么用?PHP WYSIJA::croned_weekly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WYSIJA的用法示例。


在下文中一共展示了WYSIJA::croned_weekly方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run_scheduled_task

 function run_scheduled_task($process = 'queue')
 {
     $scheduled_times = WYSIJA::get_cron_schedule($process);
     if (isset($scheduled_times['running']) && $scheduled_times['running'] && $scheduled_times['running'] + 900 > time()) {
         if ($this->report) {
             echo 'already running : ' . $process . '<br/>';
         }
         return;
     }
     WYSIJA::set_cron_schedule($process, 0, time());
     switch ($process) {
         case 'queue':
             WYSIJA::croned_queue($process);
             if (defined('WYSIJANLP')) {
                 $hPremium =& WYSIJA::get('premium', 'helper', false, WYSIJANLP);
                 $hPremium->croned_queue_process();
             }
             break;
         case 'bounce':
             if (defined('WYSIJANLP')) {
                 $hPremium =& WYSIJA::get('premium', 'helper', false, WYSIJANLP);
                 $hPremium->croned_bounce();
             }
             break;
         case 'daily':
             WYSIJA::croned_daily();
             break;
         case 'weekly':
             if (defined('WYSIJANLP')) {
                 $hPremium =& WYSIJA::get('premium', 'helper', false, WYSIJANLP);
                 $hPremium->croned_weekly();
             }
             WYSIJA::croned_weekly();
             break;
         case 'monthly':
             WYSIJA::croned_monthly();
             break;
     }
     WYSIJA::set_cron_schedule($process);
     if ($this->report) {
         echo 'processed : ' . $process . '<br/>';
     }
 }
开发者ID:sontv1003,项目名称:fashionbeans,代码行数:43,代码来源:cron.php

示例2: run_scheduled_task

 /**
  * run process if it's not detected as already running
  * @param type $process
  * @return type
  */
 function run_scheduled_task($process = 'queue')
 {
     //first let's make sure that the process asked to be run is not already running
     $scheduled_times = WYSIJA::get_cron_schedule($process);
     $processes = WYSIJA::get_cron_frequencies();
     $process_frequency = $processes[$process];
     // check if the scheduled task is already being processed,
     // we consider it timed out once the started running time plus the frequency has been passed
     if (!empty($scheduled_times['running']) && $scheduled_times['running'] + $process_frequency > time()) {
         if ($this->report) {
             echo 'already running : ' . $process . '<br/>';
         }
         return;
     }
     // set schedule as running
     WYSIJA::set_cron_schedule($process, 0, time());
     // execute schedule
     switch ($process) {
         case 'queue':
             // check if there are any scheduled newsletters ready for action
             WYSIJA::check_scheduled_newsletters();
             // if premium is activated we execute the premium cron process
             if (defined('WYSIJANLP')) {
                 $helper_premium = WYSIJA::get('premium', 'helper', false, WYSIJANLP);
                 $helper_premium->croned_queue_process();
             } else {
                 // run the standard queue process no scheduled tasks will be check since it has already been checked above
                 WYSIJA::croned_queue(false);
             }
             break;
         case 'bounce':
             $helper_premium = WYSIJA::get('premium', 'helper', false, WYSIJANLP);
             $model_config = WYSIJA::get('config', 'model');
             // if premium is activated we launch the premium function
             if (is_multisite()) {
                 $multisite_prefix = 'ms_';
             }
             // we don't process the bounce automatically unless the option is ticked
             if (defined('WYSIJANLP') && $model_config->getValue($multisite_prefix . 'bounce_process_auto')) {
                 $helper_premium->croned_bounce();
             } else {
                 $process .= ' (bounce handling not activated)';
             }
             break;
         case 'daily':
             WYSIJA::croned_daily();
             break;
         case 'weekly':
             if (defined('WYSIJANLP')) {
                 $helper_premium = WYSIJA::get('premium', 'helper', false, WYSIJANLP);
                 $helper_premium->croned_weekly();
             }
             WYSIJA::croned_weekly();
             break;
         case 'monthly':
             WYSIJA::croned_monthly();
             break;
     }
     // set next_schedule details
     WYSIJA::set_cron_schedule($process);
     if ($this->report) {
         echo 'processed : ' . $process . '<br/>';
     }
 }
开发者ID:namwoody,项目名称:SAAZINDIAN.COM,代码行数:69,代码来源:cron.php

示例3: dirname

}
if ($process) {
    /*include the needed parts of wp plus wysija*/
    $plugin_path = dirname(__FILE__);
    $wp_root = dirname(dirname(dirname($plugin_path)));
    require_once $wp_root . DIRECTORY_SEPARATOR . 'wp-config.php';
    require_once $wp_root . DIRECTORY_SEPARATOR . 'wp-includes' . DIRECTORY_SEPARATOR . 'wp-db.php';
    require_once $plugin_path . DIRECTORY_SEPARATOR . "core" . DIRECTORY_SEPARATOR . "base.php";
    if (!isset($_REQUEST[WYSIJA_CRON]) || (isset($_SERVER['argv'][1]) || $_SERVER['argv'][1] != WYSIJA_CRON)) {
        exit;
    }
    //if($report) require_once(WYSIJA_INC."debug.php");
    switch ($process) {
        case 'queue':
            WYSIJA::croned_queue();
            break;
        case 'bounce':
            WYSIJA::croned_bounce();
            break;
        case 'daily':
            WYSIJA::croned_daily();
            break;
        case 'weekly':
            WYSIJA::croned_weekly();
            break;
        case 'monthly':
            WYSIJA::croned_monthly();
            break;
    }
    //if($report) dbg('report');
}
开发者ID:rotoballer,项目名称:emily,代码行数:31,代码来源:wysija_cron.php


注:本文中的WYSIJA::croned_weekly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。