本文整理汇总了PHP中Job::getByID方法的典型用法代码示例。如果您正苦于以下问题:PHP Job::getByID方法的具体用法?PHP Job::getByID怎么用?PHP Job::getByID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job::getByID方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uninstall
function uninstall(){
Loader::model("job");
$jobObj=Job::getByID( intval($_REQUEST['jID']) );
if( $jobObj && !$jobObj->jNotUninstallable ){
$jobObj->uninstall();
}
$this->redirect('/dashboard/system/jobs');
}
示例2: uninstall
function uninstall($job_id = null)
{
if ($job_id) {
Loader::model("job");
$job = Job::getByID((int) $job_id);
if ($job) {
if (!$job->jNotUninstallable) {
$job->uninstall();
$this->set('message', t('Job succesfully uninstalled.'));
} else {
$this->error->add(t('This job cannot be uninstalled.'));
}
} else {
$this->error->add(t('Job not found.'));
}
} else {
$this->error->add(t('No job specified.'));
}
$this->view();
}
示例3: exportList
public static function exportList($xml)
{
$jl = self::getList();
if ($jl->numRows() > 0) {
$jx = $xml->addChild('jobs');
while ($r = $jl->FetchRow()) {
$j = Job::getByID($r['jID']);
$ch = $jx->addChild('job');
$ch->addAttribute('handle', $j->getJobHandle());
$ch->addAttribute('package', $j->getPackageHandle());
}
}
}
示例4: update_job_schedule
public function update_job_schedule()
{
$jID = $this->post('jID');
$J = Job::getByID($jID);
$J->setSchedule($this->post('isScheduled'), $this->post('unit'), max(0, (int) $this->post('value')));
$this->redirect('/dashboard/system/optimization/jobs', 'job_scheduled');
}
示例5: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
if (!ini_get('safe_mode')) {
@set_time_limit(0);
}
$json = Loader::helper('json');
if (Job::authenticateRequest($_REQUEST['auth'])) {
if (strlen($_REQUEST['jHandle']) > 0 || intval($_REQUEST['jID']) > 0) {
if ($_REQUEST['jHandle']) {
$job = Job::getByHandle($_REQUEST['jHandle']);
} else {
$job = Job::getByID(intval($_REQUEST['jID']));
}
}
}
if (is_object($job)) {
if ($job->supportsQueue()) {
$q = $job->getQueueObject();
if ($_POST['process']) {
$obj = new stdClass();
$js = Loader::helper('json');
try {
$messages = $q->receive($job->getJobQueueBatchSize());
foreach ($messages as $key => $p) {
$job->processQueueItem($p);
$q->deleteMessage($p);
}
$totalItems = $q->count();
$obj->totalItems = $totalItems;
if ($q->count() == 0) {
示例6: getList
public static function getList($scheduledOnly = false){
$db = Loader::db();
if($scheduledOnly) {
$q = "SELECT jID FROM Jobs WHERE isScheduled = 1 ORDER BY jDateLastRun";
} else {
$q = "SELECT jID FROM Jobs ORDER BY jDateLastRun";
}
$r = $db->Execute($q);
$jobs = array();
while ($row = $r->FetchRow()) {
$j = Job::getByID($row['jID']);
if (is_object($j)) {
$jobs[] = $j;
}
}
return $jobs;
}
示例7: getJobs
public function getJobs()
{
$db = Loader::db();
$r = $db->Execute('select jID from JobSetJobs where jsID = ? order by jID asc', $this->getJobSetId());
$jobs = array();
while ($row = $r->FetchRow()) {
$j = Job::getByID($row['jID']);
if (is_object($j)) {
$jobs[] = $j;
}
}
return $jobs;
}
示例8: defined
<?php
defined('C5_EXECUTE') or die("Access Denied.");
if (!ini_get('safe_mode')) {
@set_time_limit(0);
}
$json = Loader::helper('json');
$r = new stdClass();
$r->results = array();
if (Job::authenticateRequest($_REQUEST['auth'])) {
// Legacy
if ($_REQUEST['jID']) {
$j = Job::getByID($_REQUEST['jID']);
$obj = $j->executeJob();
print $json->encode($obj);
exit;
}
if ($_REQUEST['jHandle']) {
$j = Job::getByHandle($_REQUEST['jHandle']);
$obj = $j->executeJob();
print $json->encode($obj);
exit;
}
if ($_REQUEST['jsID']) {
$js = JobSet::getByID($_REQUEST['jsID']);
} else {
// default set legacy support
$js = JobSet::getDefault();
}
if (is_object($js)) {
$jobs = $js->getJobs();