本文整理汇总了PHP中Job::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::execute方法的具体用法?PHP Job::execute怎么用?PHP Job::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runJob
/**
* @param \MyTester\Job $job
* @return string
*/
protected function runJob(Job $job)
{
$jobName = $this->getJobName(\Nette\Reflection\Method::from($job->callback[0], $job->callback[1]));
Environment::$currentJob = $jobName;
if (!$job->skip) {
$this->setUp();
}
$job->execute();
if (!$job->skip) {
$this->tearDown();
}
Environment::$currentJob = "";
switch ($job->result) {
case "passed":
return ".";
break;
case "skipped":
return "s";
break;
case "failed":
return "F";
break;
}
return "";
}
示例2: execute
/**
* run the job, then remove it from the joblist
*
* @param JobList $jobList
* @param \OC\Log $logger
*/
public function execute($jobList, $logger = null)
{
$jobList->remove($this, $this->argument);
parent::execute($jobList, $logger);
}
示例3: execute
/**
* run the job if
*
* @param JobList $jobList
* @param \OC\Log $logger
*/
public function execute($jobList, $logger = null)
{
if (time() - $this->lastRun > $this->interval) {
parent::execute($jobList, $logger);
}
}