19declare(strict_types=1);
24use Symfony\Component\Console\Input\InputInterface;
25use Symfony\Component\Console\Output\OutputInterface;
26use Symfony\Component\Console\Input\InputArgument;
27use Symfony\Component\Console\Style\StyleInterface;
28use Symfony\Component\Console\Style\SymfonyStyle;
40 $this->setDescription(
'Runs cron jobs depending on the respective schedule');
42 $this->addArgument(
'user', InputArgument::REQUIRED,
'The ILIAS user the script is executed with');
43 $this->addArgument(
'client_id', InputArgument::REQUIRED,
'The ILIAS client_id');
46 protected function execute(InputInterface $input, OutputInterface $output):
int
48 $this->style =
new SymfonyStyle($input, $output);
50 $cron = new \ILIAS\Cron\CLI\StartUp(
51 $input->getArgument(
'client_id'),
52 $input->getArgument(
'user')
56 $cron->authenticate();
60 $this->style->success(
'Success');
63 }
catch (\Throwable
$e) {
64 $this->style->error(
$e->getMessage());
65 $this->style->error(
$e->getTraceAsString());
78 $DIC->cron()->manager()
80 $strict_job_manager->runActiveJobs(
$DIC->user());
withAuthenticated(InputInterface $input, OutputInterface $output)
execute(InputInterface $input, OutputInterface $output)