ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 

Static Public Attributes

static bool $might_populate_ini_files_as_well = true
 

Protected Member Functions

 getClientDir ($client_id)
 

Detailed Description

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

Member Function Documentation

◆ achieve()

ilIniFilesLoadedObjective::achieve ( Setup\Environment  $environment)

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

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

71  : Setup\Environment
72  {
73  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
74  if ($client_id === null) {
75  throw new Setup\UnachievableException(
76  "To initialize the ini-files, we need a client id, but it does not " .
77  "exist in the environment."
78  );
79  }
80 
81  if ($environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI) == null) {
82  $path = dirname(__DIR__, 2) . "/ilias.ini.php";
83  $ini = new ilIniFile($path);
84  $ini->read();
85  $environment = $environment
86  ->withResource(Setup\Environment::RESOURCE_ILIAS_INI, $ini);
87  }
88 
89  if ($environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI) == null) {
90  $path = $this->getClientDir($client_id) . "/client.ini.php";
91  $client_ini = new ilIniFile($path);
92  $client_ini->read();
93  $environment = $environment
94  ->withResource(Setup\Environment::RESOURCE_CLIENT_INI, $client_ini);
95  }
96 
97  return $environment;
98  }
$path
Definition: ltiservices.php:32
$client_id
Definition: ltiauth.php:68
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ini
Definition: raiseError.php:4
+ Here is the call graph for this function:

◆ getClientDir()

ilIniFilesLoadedObjective::getClientDir (   $client_id)
protected

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

Referenced by achieve().

111  : string
112  {
113  return dirname(__DIR__, 2) . "/data/$client_id";
114  }
+ Here is the caller graph for this function:

◆ getHash()

ilIniFilesLoadedObjective::getHash ( )

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

42  : string
43  {
44  return hash("sha256", self::class);
45  }

◆ getLabel()

ilIniFilesLoadedObjective::getLabel ( )

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

47  : string
48  {
49  return "The ilias.ini.php and client.ini.php are loaded";
50  }

◆ getPreconditions()

ilIniFilesLoadedObjective::getPreconditions ( Setup\Environment  $environment)

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

57  : array
58  {
59  if (self::$might_populate_ini_files_as_well) {
60  return [
61  new Setup\Objective\ClientIdReadObjective(),
63  ];
64  } else {
65  return [
66  new Setup\Objective\ClientIdReadObjective(),
67  ];
68  }
69  }

◆ isApplicable()

ilIniFilesLoadedObjective::isApplicable ( Setup\Environment  $environment)

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

References $ini.

103  : bool
104  {
105  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
106  $client_ini = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_INI);
107 
108  return is_null($ini) || is_null($client_ini);
109  }
$ini
Definition: raiseError.php:4

◆ isNotable()

ilIniFilesLoadedObjective::isNotable ( )

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

52  : bool
53  {
54  return false;
55  }

Field Documentation

◆ $might_populate_ini_files_as_well

bool ilIniFilesLoadedObjective::$might_populate_ini_files_as_well = true
static

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