本文整理汇总了PHP中cron::forceJob方法的典型用法代码示例。如果您正苦于以下问题:PHP cron::forceJob方法的具体用法?PHP cron::forceJob怎么用?PHP cron::forceJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cron
的用法示例。
在下文中一共展示了cron::forceJob方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: syncallocations
public function syncallocations()
{
global $init;
require_once PATH_CORE . '/classes/cron.class.php';
$cObj = new cron($init['apiKey']);
$cObj->forceJob('facebookAllocations');
echo 'Completed';
set_flash(array('notice' => "Finished synching allocations"));
redirect(url_for($this->name, 'index'));
}
示例2: run_cronjob
public function run_cronjob()
{
global $init;
require_once PATH_CORE . '/classes/cron.class.php';
$cObj = new cron($init['apiKey']);
if (isset($_GET['task'])) {
$task = $_GET['task'];
$cObj->forceJob($task);
set_flash(array('notice' => "Cron job ({$task}) completed."));
redirect(url_for($this->name, 'cronjobs'));
} else {
set_flash(array('error' => "Invalid cron job -- aborted."));
redirect(url_for($this->name, 'cronjobs'));
}
}
示例3: cleanupFacebook
require_once PATH_FACEBOOK . '/classes/cleanupFacebook.class.php';
$cleanupObj = new cleanupFacebook($db, '');
$cleanupObj->flushDatabase();
echo 'fb/st Database cleansed<br />';
}
break;
case 'resetLog':
$db->delete("Log");
// for debug purposes
break;
case 'testJob':
$job = $_GET['job'];
echo 'Testing job:' . $job . '<br>';
require_once PATH_CORE . '/classes/cron.class.php';
$cObj = new cron($init['apiKey']);
$cObj->forceJob($job);
break;
case 'cleanupUser':
require_once PATH_CORE . '/classes/teamBackend.class.php';
$teamObj = new teamBackend($db);
$teamObj->cleanupUser($_GET['userid']);
break;
/* deprecated
case 'rewardBetaTesters':
require_once (PATH_CORE. '/classes/teamBackend.class.php');
$teamObj = new teamBackend($db);
$teamObj->rewardBetaTesters();
break;
case 'reSync':
// call all cron jobs with new sync info
require_once(PATH_CORE.'/classes/cron.class.php');
示例4: cron
die;
}
// override default time limit
set_time_limit(300);
require_once PATH_CORE . '/classes/cron.class.php';
$cObj = new cron($init['apiKey']);
echo 'Starting CRON engine.<br />';
// when you set init variable, we populate the job list for the first time
if (isset($_GET['init'])) {
echo 'Initialize cron jobs...';
$cObj->initJobs();
$cObj->resetJobs();
$cObj->fetchJobs();
echo 'exiting now...';
exit;
}
if (isset($_GET['reset'])) {
echo 'Reset cron jobs...';
$cObj->resetJobs();
echo 'exiting now...';
exit;
}
if (isset($_GET['force'])) {
// only run this one job
$cObj->forceJob($_GET['force']);
} else {
// run the jobs
$cObj->fetchJobs();
}
$cObj->hasDeadTasks();
echo 'Exiting CRON engine.<br />';