ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Setup\Activities\GetStatus Class Reference

This is a stub: the status of the installation is not collected yet. More...

+ Inheritance diagram for ILIAS\Setup\Activities\GetStatus:
+ Collaboration diagram for ILIAS\Setup\Activities\GetStatus:

Public Member Functions

 __construct (private readonly DataFactory $data=new DataFactory(),)
 
 getDescription ()
 
 getInputDescription (FieldFactory $f)
 
 getOutputDescription (Description\Factory $f)
 
 isAllowedToPerform (int $usr_id, mixed $parameters)
 Nobody, until there is something to report and a check for administrators to guard it. More...
 
 perform (mixed $parameters)
 This shall perform the activity. More...
 
 maybePerformAs (InputFactory $input_factory, int $usr_id, array $raw_parameters)
 
- Public Member Functions inherited from ILIAS\Component\Activities\Query
 getType ()
 
- Public Member Functions inherited from ILIAS\Component\Activities\ActivityImpl
 getName ()
 Shall return classname of the Activity, wrapped in Name. More...
 
 getName ()
 Shall return classname of the Activity, wrapped in Name. More...
 
 getType ()
 
 getDescription ()
 
 getInputDescription (FieldFactory $f)
 
 getOutputDescription (Description\Factory $f)
 
 isAllowedToPerform (int $usr_id, mixed $parameters)
 This shall check if the given user is allowed to perform the activity based on business rules of this component. More...
 
 perform (mixed $parameters)
 This shall perform the activity. More...
 
 maybePerformAs (InputFactory $input_factory, int $usr_id, array $raw_parameters)
 Grinds the $raw_parameters through the input description, checks if the users is allowed to perform the action as requested and, if so, then attempts to performs it. More...
 

Detailed Description

This is a stub: the status of the installation is not collected yet.

It is a safe one, though. What the setup knows - versions, pending updates, parts of the configuration - is nothing for everybody with a session, so nobody is allowed to perform this until it does something and is guarded by a real check for administrators. Until then every call is answered with a refusal instead of a TypeError.

Definition at line 40 of file GetStatus.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Activities\GetStatus::__construct ( private readonly DataFactory  $data = new DataFactory())

Definition at line 42 of file GetStatus.php.

44 {
45 }

Member Function Documentation

◆ getDescription()

ILIAS\Setup\Activities\GetStatus::getDescription ( )

Implements ILIAS\Component\Activities\Activity.

Definition at line 47 of file GetStatus.php.

47 : Text\SimpleDocumentMarkdown
48 {
49 return $this->data->text()->markdown()->simpleDocument(
50 "Reports the status of the installation.\n\n"
51 . "Not available yet: nobody is allowed to perform it."
52 );
53 }

◆ getInputDescription()

ILIAS\Setup\Activities\GetStatus::getInputDescription ( FieldFactory  $f)

Implements ILIAS\Component\Activities\Activity.

Definition at line 55 of file GetStatus.php.

55 : FormInput
56 {
57 return $f->section([], 'Get the status of the installation');
58 }

References Vendor\Package\$f.

◆ getOutputDescription()

ILIAS\Setup\Activities\GetStatus::getOutputDescription ( Description\Factory  $f)

Implements ILIAS\Component\Activities\Activity.

Definition at line 60 of file GetStatus.php.

60 : Description\Description
61 {
62 return $f->object(
63 $this->data->text()->markdown()->simpleDocument('The status of the installation.'),
64 []
65 );
66 }

References Vendor\Package\$f.

◆ isAllowedToPerform()

ILIAS\Setup\Activities\GetStatus::isAllowedToPerform ( int  $usr_id,
mixed  $parameters 
)

Nobody, until there is something to report and a check for administrators to guard it.

Implements ILIAS\Component\Activities\Activity.

Definition at line 72 of file GetStatus.php.

72 : bool
73 {
74 return false;
75 }

Referenced by ILIAS\Setup\Activities\GetStatus\maybePerformAs().

+ Here is the caller graph for this function:

◆ maybePerformAs()

ILIAS\Setup\Activities\GetStatus::maybePerformAs ( InputFactory  $input_factory,
int  $usr_id,
array  $raw_parameters 
)
Parameters
array<string,mixed>$raw_parameters

Implements ILIAS\Component\Activities\Activity.

Definition at line 85 of file GetStatus.php.

85 : Result
86 {
87 if (!$this->isAllowedToPerform($usr_id, $raw_parameters)) {
88 return $this->data->error(
89 new \DomainException('You are not allowed to get the status of the installation.', 403)
90 );
91 }
92
93 try {
94 return $this->data->ok($this->perform($raw_parameters));
95 } catch (\Exception $e) {
96 return $this->data->error($e);
97 }
98 }
isAllowedToPerform(int $usr_id, mixed $parameters)
Nobody, until there is something to report and a check for administrators to guard it.
Definition: GetStatus.php:72
perform(mixed $parameters)
This shall perform the activity.
Definition: GetStatus.php:77

References Vendor\Package\$e, ILIAS\Data\Result\error(), ILIAS\Setup\Activities\GetStatus\isAllowedToPerform(), and ILIAS\Setup\Activities\GetStatus\perform().

+ Here is the call graph for this function:

◆ perform()

ILIAS\Setup\Activities\GetStatus::perform ( mixed  $parameters)

This shall perform the activity.

This shall not check if a user is allowed to perform the activity. The returned data should match the Description given by getOutputDescription.

Exceptions
anySPL Exception (https://www.php.net/manual/en/spl.exceptions.php)
Parameters
mixed$parameterswhatever the FormInput from getInputDescription produces.

Implements ILIAS\Component\Activities\Activity.

Definition at line 77 of file GetStatus.php.

77 : mixed
78 {
79 throw new \LogicException('The status of the installation is not available yet.');
80 }

Referenced by ILIAS\Setup\Activities\GetStatus\maybePerformAs().

+ Here is the caller graph for this function:

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