예제 #1
0
}
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');
}