ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\ArrayEnvironment Class Reference
+ Inheritance diagram for ILIAS\Setup\ArrayEnvironment:
+ Collaboration diagram for ILIAS\Setup\ArrayEnvironment:

Public Member Functions

 __construct (array $resources)
 
 getResource (string $id)
 Consumers of this method should check if the result is what they expect, e.g.implements some known interface.
Returns
mixed|null
More...
 
 withResource (string $id, $resource)
 
Exceptions
More...
 
 withConfigFor (string $component, $config)
 Stores a config for some component in the environment.
Exceptions
More...
 
 getConfigFor (string $component)
 
Exceptions
More...
 

Protected Attributes

 $resources
 
 $configs
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Setup\Environment
const RESOURCE_DATABASE = "resource_database"
 
const RESOURCE_ADMIN_INTERACTION = "resource_admin_interaction"
 
const RESOURCE_ACHIEVEMENT_TRACKER = "resource_achievement_tracker"
 
const RESOURCE_ILIAS_INI = "resource_ilias_ini"
 
const RESOURCE_CLIENT_INI = "resource_client_ini"
 
const RESOURCE_SETTINGS_FACTORY = "resource_settings_factory"
 

Detailed Description

Definition at line 9 of file ArrayEnvironment.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\ArrayEnvironment::__construct ( array  $resources)

Definition at line 21 of file ArrayEnvironment.php.

References ILIAS\Setup\ArrayEnvironment\$resources.

22  {
23  $this->resources = $resources;
24  }

Member Function Documentation

◆ getConfigFor()

ILIAS\Setup\ArrayEnvironment::getConfigFor ( string  $component)

Exceptions

Implements ILIAS\Setup\Environment.

Definition at line 70 of file ArrayEnvironment.php.

71  {
72  if (!isset($this->configs[$component])) {
73  throw new \RuntimeException(
74  "Config for '$component' is not contained in the environment"
75  );
76  }
77  return $this->configs[$component];
78  }

◆ getResource()

ILIAS\Setup\ArrayEnvironment::getResource ( string  $id)

Consumers of this method should check if the result is what they expect, e.g.implements some known interface.

Returns
mixed|null

Implements ILIAS\Setup\Environment.

Definition at line 29 of file ArrayEnvironment.php.

30  {
31  if (!isset($this->resources[$id])) {
32  return null;
33  }
34  return $this->resources[$id];
35  }

◆ withConfigFor()

ILIAS\Setup\ArrayEnvironment::withConfigFor ( string  $component,
  $config 
)

Stores a config for some component in the environment.

Exceptions

Implements ILIAS\Setup\Environment.

Definition at line 55 of file ArrayEnvironment.php.

References $config.

Referenced by ILIAS\Setup\CLI\ReloadControlStructureCommand\buildEnvironment(), ILIAS\Setup\CLI\UpdateCommand\buildEnvironment(), and ILIAS\Setup\CLI\InstallCommand\buildEnvironment().

55  : Environment
56  {
57  if (isset($this->configs[$component])) {
58  throw new \RuntimeException(
59  "Config for '$component' is already contained in the environment"
60  );
61  }
62  $clone = clone $this;
63  $clone->configs[$component] = $config;
64  return $clone;
65  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
+ Here is the caller graph for this function:

◆ withResource()

ILIAS\Setup\ArrayEnvironment::withResource ( string  $id,
  $resource 
)

Exceptions

Implements ILIAS\Setup\Environment.

Definition at line 40 of file ArrayEnvironment.php.

40  : Environment
41  {
42  if (isset($this->resources[$id])) {
43  throw new \RuntimeException(
44  "Resource '$id' is already contained in the environment"
45  );
46  }
47  $clone = clone $this;
48  $clone->resources[$id] = $resource;
49  return $clone;
50  }

Field Documentation

◆ $configs

ILIAS\Setup\ArrayEnvironment::$configs
protected

Definition at line 19 of file ArrayEnvironment.php.

◆ $resources

ILIAS\Setup\ArrayEnvironment::$resources
protected

Definition at line 14 of file ArrayEnvironment.php.

Referenced by ILIAS\Setup\ArrayEnvironment\__construct().


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