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

Public Member Functions

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

Static Public Attributes

static $might_populate_ini_files_as_well = true
 

Protected Member Functions

 getClientDir ($client_id)
 

Detailed Description

Definition at line 7 of file class.ilIniFilesLoadedObjective.php.

Member Function Documentation

◆ achieve()

ilIniFilesLoadedObjective::achieve ( Setup\Environment  $environment)

Definition at line 55 of file class.ilIniFilesLoadedObjective.php.

55 : Setup\Environment
56 {
57 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
58 if ($client_id === null) {
59 throw new Setup\UnachievableException(
60 "To initialize the ini-files, we need a client id, but it does not " .
61 "exist in the environment."
62 );
63 }
64
65 if ($environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI) == null) {
66 $path = dirname(__DIR__, 2) . "/ilias.ini.php";
67 $ini = new ilIniFile($path);
68 $ini->read();
69 $environment = $environment
70 ->withResource(Setup\Environment::RESOURCE_ILIAS_INI, $ini);
71 }
72
73 if ($environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI) == null) {
74 $path = $this->getClientDir($client_id) . "/client.ini.php";
75 $client_ini = new ilIniFile($path);
76 $client_ini->read();
77 $environment = $environment
78 ->withResource(Setup\Environment::RESOURCE_CLIENT_INI, $client_ini);
79 }
80
81 return $environment;
82 }
INIFile Parser.
$ini
Definition: raiseError.php:4
$client_id
Definition: webdav.php:17

References $client_id, $ini, and getClientDir().

+ Here is the call graph for this function:

◆ getClientDir()

ilIniFilesLoadedObjective::getClientDir (   $client_id)
protected

Definition at line 95 of file class.ilIniFilesLoadedObjective.php.

95 : string
96 {
97 return dirname(__DIR__, 2) . "/data/$client_id";
98 }

Referenced by achieve().

+ Here is the caller graph for this function:

◆ getHash()

ilIniFilesLoadedObjective::getHash ( )

Definition at line 26 of file class.ilIniFilesLoadedObjective.php.

26 : string
27 {
28 return hash("sha256", self::class);
29 }

◆ getLabel()

ilIniFilesLoadedObjective::getLabel ( )

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

31 : string
32 {
33 return "The ilias.ini.php and client.ini.php are loaded";
34 }

◆ getPreconditions()

ilIniFilesLoadedObjective::getPreconditions ( Setup\Environment  $environment)

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

41 : array
42 {
43 if (self::$might_populate_ini_files_as_well) {
44 return [
45 new Setup\Objective\ClientIdReadObjective(),
47 ];
48 } else {
49 return [
50 new Setup\Objective\ClientIdReadObjective(),
51 ];
52 }
53 }

◆ isApplicable()

ilIniFilesLoadedObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Definition at line 87 of file class.ilIniFilesLoadedObjective.php.

87 : bool
88 {
89 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
90 $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
91
92 return is_null($ini) || is_null($client_ini);
93 }

References $ini.

◆ isNotable()

ilIniFilesLoadedObjective::isNotable ( )

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

36 : bool
37 {
38 return false;
39 }

Field Documentation

◆ $might_populate_ini_files_as_well

ilIniFilesLoadedObjective::$might_populate_ini_files_as_well = true
static

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