ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Cron\CLI\Commands\RunActiveJobsCommand Class Reference
+ Inheritance diagram for ILIAS\Cron\CLI\Commands\RunActiveJobsCommand:
+ Collaboration diagram for ILIAS\Cron\CLI\Commands\RunActiveJobsCommand:

Protected Member Functions

 configure ()
 
 execute (InputInterface $input, OutputInterface $output)
 

Static Protected Attributes

static $defaultName = 'run-jobs'
 

Private Member Functions

 withAuthenticated (InputInterface $input, OutputInterface $output)
 

Private Attributes

 $style
 

Detailed Description

Definition at line 31 of file RunActiveJobsCommand.php.

Member Function Documentation

◆ configure()

ILIAS\Cron\CLI\Commands\RunActiveJobsCommand::configure ( )
protected

Definition at line 38 of file RunActiveJobsCommand.php.

38  : void
39  {
40  $this->setDescription('Runs cron jobs depending on the respective schedule');
41 
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');
44  }

◆ execute()

ILIAS\Cron\CLI\Commands\RunActiveJobsCommand::execute ( InputInterface  $input,
OutputInterface  $output 
)
protected

Definition at line 46 of file RunActiveJobsCommand.php.

References $cron, Vendor\Package\$e, and ILIAS\Cron\CLI\Commands\RunActiveJobsCommand\withAuthenticated().

46  : int
47  {
48  $this->style = new SymfonyStyle($input, $output);
49 
50  $cron = new \ILIAS\Cron\CLI\StartUp(
51  $input->getArgument('client_id'),
52  $input->getArgument('user')
53  );
54 
55  try {
56  $cron->authenticate();
57 
58  $this->withAuthenticated($input, $output);
59 
60  $this->style->success('Success');
61 
62  return 0;
63  } catch (\Throwable $e) {
64  $this->style->error($e->getMessage());
65  $this->style->error($e->getTraceAsString());
66 
67  return 1;
68  } finally {
69  $cron->logout();
70  }
71  }
withAuthenticated(InputInterface $input, OutputInterface $output)
$cron
Definition: cron.php:26
+ Here is the call graph for this function:

◆ withAuthenticated()

ILIAS\Cron\CLI\Commands\RunActiveJobsCommand::withAuthenticated ( InputInterface  $input,
OutputInterface  $output 
)
private

Definition at line 73 of file RunActiveJobsCommand.php.

References $DIC, and ILIAS\BackgroundTasks\Task\Job\Manager\StrictCliJobManager\runActiveJobs().

Referenced by ILIAS\Cron\CLI\Commands\RunActiveJobsCommand\execute().

73  : void
74  {
75  global $DIC;
76 
77  $strict_job_manager = new StrictCliJobManager(
78  $DIC->cron()->manager()
79  );
80  $strict_job_manager->runActiveJobs($DIC->user());
81  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $defaultName

ILIAS\Cron\CLI\Commands\RunActiveJobsCommand::$defaultName = 'run-jobs'
staticprotected

Definition at line 33 of file RunActiveJobsCommand.php.

◆ $style

ILIAS\Cron\CLI\Commands\RunActiveJobsCommand::$style
private

Definition at line 36 of file RunActiveJobsCommand.php.


The documentation for this class was generated from the following file: