ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilStrictCliCronManager.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function __construct(protected ilCronManager $cronManager)
24  {
25  }
26 
30  private function getValidPhpApis(): array
31  {
32  return [
33  'cli'
34  ];
35  }
36 
37  public function runActiveJobs(ilObjUser $actor): void
38  {
39  if (in_array(PHP_SAPI, array_map('strtolower', $this->getValidPhpApis()), true)) {
40  $this->cronManager->runActiveJobs($actor);
41  }
42  }
43 
44  public function runJobManual(string $jobId, ilObjUser $actor): bool
45  {
46  return $this->cronManager->runJobManual($jobId, $actor);
47  }
48 
49  public function resetJob(ilCronJob $job, ilObjUser $actor): void
50  {
51  $this->cronManager->resetJob($job, $actor);
52  }
53 
54  public function activateJob(ilCronJob $job, ilObjUser $actor, bool $wasManuallyExecuted = false): void
55  {
56  $this->cronManager->activateJob($job, $actor, $wasManuallyExecuted);
57  }
58 
59  public function deactivateJob(ilCronJob $job, ilObjUser $actor, bool $wasManuallyExecuted = false): void
60  {
61  $this->cronManager->deactivateJob($job, $actor, $wasManuallyExecuted);
62  }
63 
64  public function isJobActive(string $jobId): bool
65  {
66  return $this->cronManager->isJobActive($jobId);
67  }
68 
69  public function isJobInactive(string $jobId): bool
70  {
71  return $this->cronManager->isJobInactive($jobId);
72  }
73 
74  public function ping(string $jobId): void
75  {
76  $this->cronManager->ping($jobId);
77  }
78 }
runJobManual(string $jobId, ilObjUser $actor)
activateJob(ilCronJob $job, ilObjUser $actor, bool $wasManuallyExecuted=false)
__construct(protected ilCronManager $cronManager)
deactivateJob(ilCronJob $job, ilObjUser $actor, bool $wasManuallyExecuted=false)
resetJob(ilCronJob $job, ilObjUser $actor)