Example #1
0
    } else {
        switch ($_GET['sec']) {
            case "generate":
                $controller->routeCronJob($_GET['website_id'], $_GET['repTools']);
                break;
            case "croncommand":
                $controller->showCronCommand();
                break;
            default:
                $controller->showReportGenerationManager();
                break;
        }
    }
} else {
    # the section for generate reports using system cron job
    include_once "includes/sp-load.php";
    include_once SP_CTRLPATH . "/cron.ctrl.php";
    include_once SP_CTRLPATH . "/report.ctrl.php";
    include_once SP_CTRLPATH . "/searchengine.ctrl.php";
    include_once SP_CTRLPATH . "/keyword.ctrl.php";
    $controller = new CronController();
    $controller->timeStamp = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
    $includeList = array();
    // the only included seo tools id
    $controller->executeCron($includeList);
    // delete crawl logs before 2 months
    include_once SP_CTRLPATH . "/crawllog.ctrl.php";
    $crawlLog = new CrawlLogController();
    $crawlLog->clearCrawlLog(SP_CRAWL_LOG_CLEAR_TIME);
    echo "Clearing crawl logs before " . SP_CRAWL_LOG_CLEAR_TIME . " days";
}