ILIAS  release_8 Revision v8.24
ilPreviewConfigStoredObjective Class Reference
+ Inheritance diagram for ilPreviewConfigStoredObjective:
+ Collaboration diagram for ilPreviewConfigStoredObjective:

Public Member Functions

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

Protected Attributes

ilPreviewSetupConfig $config
 

Detailed Description

Definition at line 21 of file class.ilPreviewConfigStoredObjective.php.

Constructor & Destructor Documentation

◆ __construct()

ilPreviewConfigStoredObjective::__construct ( \ilPreviewSetupConfig  $config)

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

27 {
28 $this->config = $config;
29 }

References $config.

Member Function Documentation

◆ achieve()

ilPreviewConfigStoredObjective::achieve ( Setup\Environment  $environment)

Definition at line 56 of file class.ilPreviewConfigStoredObjective.php.

56 : Setup\Environment
57 {
58 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
59
60 $ini->setVariable(
61 "tools",
62 "ghostscript",
63 $this->config->getPathToGhostscript() ?? ''
64 );
65
66 if (!$ini->write()) {
67 throw new Setup\UnachievableException("Could not write ilias.ini.php");
68 }
69
70 return $environment;
71 }
$ini
Definition: raiseError.php:4

References $ini.

◆ getHash()

ilPreviewConfigStoredObjective::getHash ( )

Definition at line 31 of file class.ilPreviewConfigStoredObjective.php.

31 : string
32 {
33 return hash("sha256", self::class);
34 }

◆ getLabel()

ilPreviewConfigStoredObjective::getLabel ( )

Definition at line 36 of file class.ilPreviewConfigStoredObjective.php.

36 : string
37 {
38 return "Store configuration of Services/Preview";
39 }

◆ getPreconditions()

ilPreviewConfigStoredObjective::getPreconditions ( Setup\Environment  $environment)
Returns
\ilIniFilesLoadedObjective[]

Definition at line 49 of file class.ilPreviewConfigStoredObjective.php.

49 : array
50 {
51 return [
53 ];
54 }

◆ isApplicable()

ilPreviewConfigStoredObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 76 of file class.ilPreviewConfigStoredObjective.php.

76 : bool
77 {
78 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
79
80 return $ini->readVariable("tools", "ghostscript") !== $this->config->getPathToGhostscript();
81 }

References $ini.

◆ isNotable()

ilPreviewConfigStoredObjective::isNotable ( )

Definition at line 41 of file class.ilPreviewConfigStoredObjective.php.

41 : bool
42 {
43 return false;
44 }

Field Documentation

◆ $config

ilPreviewSetupConfig ilPreviewConfigStoredObjective::$config
protected

Definition at line 23 of file class.ilPreviewConfigStoredObjective.php.

Referenced by __construct().


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