ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilIniFilesPopulatedObjective Class Reference
+ Inheritance diagram for ilIniFilesPopulatedObjective:
+ Collaboration diagram for ilIniFilesPopulatedObjective:

Public Member Functions

 getHash ()
 
 getLabel ()
 
 isNotable ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Member Functions

 getClientDir (string $client_id)
 
 getClientIniPath (string $client_id)
 
 getILIASIniPath ()
 

Detailed Description

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

Member Function Documentation

◆ achieve()

ilIniFilesPopulatedObjective::achieve ( Setup\Environment  $environment)

Definition at line 45 of file class.ilIniFilesPopulatedObjective.php.

References $client_id, $ini, getClientIniPath(), and getILIASIniPath().

45  : Setup\Environment
46  {
47  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
48 
49  $path = $this->getILIASIniPath();
50  if (!file_exists($path)) {
51  $ini = new ilIniFile($path);
52  $ini->GROUPS = parse_ini_file(__DIR__ . "/../ilias.master.ini.php", true);
53  $ini->write();
54  $environment = $environment
55  ->withResource(Setup\Environment::RESOURCE_ILIAS_INI, $ini);
56  }
57 
58  $path = $this->getClientIniPath($client_id);
59  if (!file_exists($path)) {
60  $client_ini = new ilIniFile($path);
61  $client_ini->GROUPS = parse_ini_file(__DIR__ . "/../client.master.ini.php", true);
62  $client_ini->write();
63  $environment = $environment
64  ->withResource(Setup\Environment::RESOURCE_CLIENT_INI, $client_ini);
65  }
66 
67  return $environment;
68  }
$client_id
Definition: webdav.php:17
INIFile Parser.
$ini
Definition: raiseError.php:4
+ Here is the call graph for this function:

◆ getClientDir()

ilIniFilesPopulatedObjective::getClientDir ( string  $client_id)
protected

Definition at line 81 of file class.ilIniFilesPopulatedObjective.php.

References $client_id.

Referenced by getClientIniPath(), and getPreconditions().

81  : string
82  {
83  return dirname(__DIR__, 2) . "/data/" . $client_id;
84  }
$client_id
Definition: webdav.php:17
+ Here is the caller graph for this function:

◆ getClientIniPath()

ilIniFilesPopulatedObjective::getClientIniPath ( string  $client_id)
protected

Definition at line 86 of file class.ilIniFilesPopulatedObjective.php.

References getClientDir().

Referenced by achieve(), and isApplicable().

86  : string
87  {
88  return $this->getClientDir($client_id) . "/client.ini.php";
89  }
$client_id
Definition: webdav.php:17
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHash()

ilIniFilesPopulatedObjective::getHash ( )

Definition at line 9 of file class.ilIniFilesPopulatedObjective.php.

9  : string
10  {
11  return hash("sha256", self::class);
12  }

◆ getILIASIniPath()

ilIniFilesPopulatedObjective::getILIASIniPath ( )
protected

Definition at line 91 of file class.ilIniFilesPopulatedObjective.php.

Referenced by achieve(), and isApplicable().

91  : string
92  {
93  return dirname(__DIR__, 2) . "/ilias.ini.php";
94  }
+ Here is the caller graph for this function:

◆ getLabel()

ilIniFilesPopulatedObjective::getLabel ( )

Definition at line 14 of file class.ilIniFilesPopulatedObjective.php.

14  : string
15  {
16  return "The ilias.ini.php and client.ini.php are populated.";
17  }

◆ getPreconditions()

ilIniFilesPopulatedObjective::getPreconditions ( Setup\Environment  $environment)

Definition at line 24 of file class.ilIniFilesPopulatedObjective.php.

References $client_id, and getClientDir().

24  : array
25  {
26  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
27  if ($client_id === null) {
28  throw new \LogicException(
29  "Expected a client_id in the environment."
30  );
31  }
32  $client_dir = $this->getClientDir($client_id);
33 
34  // TODO: This shows an unfortunate connection between the webdir and the
35  // client.ini.php. Why does the client.ini reside in the webdir? If we
36  // remove the client-feature, the client-ini will go away...
37  return [
38  new Setup\Objective\DirectoryCreatedObjective(dirname(__DIR__, 2) . "/data"),
39  new Setup\Objective\DirectoryCreatedObjective($client_dir),
40  new Setup\Condition\CanCreateFilesInDirectoryCondition($client_dir),
41  new Setup\Condition\CanCreateFilesInDirectoryCondition(dirname(__DIR__, 2))
42  ];
43  }
$client_id
Definition: webdav.php:17
+ Here is the call graph for this function:

◆ isApplicable()

ilIniFilesPopulatedObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 73 of file class.ilIniFilesPopulatedObjective.php.

References $client_id, getClientIniPath(), and getILIASIniPath().

73  : bool
74  {
75  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
76 
77  return !file_exists($this->getILIASIniPath())
78  || !file_exists($this->getClientIniPath($client_id));
79  }
$client_id
Definition: webdav.php:17
+ Here is the call graph for this function:

◆ isNotable()

ilIniFilesPopulatedObjective::isNotable ( )

Definition at line 19 of file class.ilIniFilesPopulatedObjective.php.

19  : bool
20  {
21  return true;
22  }

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