ILIAS  release_7 Revision v7.30-3-g800a261c036
ilBackgroundTasksConfigStoredObjective Class Reference
+ Inheritance diagram for ilBackgroundTasksConfigStoredObjective:
+ Collaboration diagram for ilBackgroundTasksConfigStoredObjective:

Public Member Functions

 __construct (\ilBackgroundTasksSetupConfig $config)
 
 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 

Protected Attributes

 $config
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBackgroundTasksConfigStoredObjective::__construct ( \ilBackgroundTasksSetupConfig  $config)

Member Function Documentation

◆ achieve()

ilBackgroundTasksConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 42 of file class.ilBackgroundTasksConfigStoredObjective.php.

42 : Setup\Environment
43 {
44 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
45
46 if (!$ini->groupExists("background_tasks")) {
47 $ini->addGroup("background_tasks");
48 }
49
50 $ini->setVariable("background_tasks", "concurrency", $this->config->getType());
51 $ini->setVariable("background_tasks", "number_of_concurrent_tasks", $this->config->getMaxCurrentTasks());
52
53 if (!$ini->write()) {
54 throw new Setup\UnachievableException("Could not write ilias.ini.php");
55 }
56
57 return $environment;
58 }
$ini
Definition: raiseError.php:4

References $ini.

◆ getHash()

ilBackgroundTasksConfigStoredObjective::getHash ( )

Definition at line 20 of file class.ilBackgroundTasksConfigStoredObjective.php.

20 : string
21 {
22 return hash("sha256", self::class);
23 }

◆ getLabel()

ilBackgroundTasksConfigStoredObjective::getLabel ( )

Definition at line 25 of file class.ilBackgroundTasksConfigStoredObjective.php.

25 : string
26 {
27 return "Fill ini with settings for Services/BackgroundTasks";
28 }

◆ getPreconditions()

ilBackgroundTasksConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 35 of file class.ilBackgroundTasksConfigStoredObjective.php.

35 : array
36 {
37 return [
39 ];
40 }

◆ isApplicable()

ilBackgroundTasksConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 63 of file class.ilBackgroundTasksConfigStoredObjective.php.

63 : bool
64 {
65 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
66
67 return
68 !$ini->groupExists("background_tasks") ||
69 $ini->readVariable("background_tasks", "concurrency") !== $this->config->getType() ||
70 $ini->readVariable("background_tasks", "number_of_concurrent_tasks") !== $this->config->getMaxCurrentTasks()
71 ;
72 }

References $ini.

◆ isNotable()

ilBackgroundTasksConfigStoredObjective::isNotable ( )

Definition at line 30 of file class.ilBackgroundTasksConfigStoredObjective.php.

30 : bool
31 {
32 return false;
33 }

Field Documentation

◆ $config

ilBackgroundTasksConfigStoredObjective::$config
protected

Definition at line 12 of file class.ilBackgroundTasksConfigStoredObjective.php.

Referenced by __construct().


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