ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
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...
 
 hasConfigFor (string $component)
 

Protected Attributes

array $resources
 
array $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_ILIAS_INI = "resource_ilias_ini"
 
const RESOURCE_CLIENT_INI = "resource_client_ini"
 
const RESOURCE_SETTINGS_FACTORY = "resource_settings_factory"
 
const RESOURCE_CLIENT_ID = "resource_client_id"
 
const RESOURCE_PLUGIN_ADMIN = "resource_plugin_admin"
 
const RESOURCE_COMPONENT_REPOSITORY = "resource_component_repository"
 
const RESOURCE_COMPONENT_FACTORY = "resource_component_factory"
 

Detailed Description

Definition at line 25 of file ArrayEnvironment.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 37 of file ArrayEnvironment.php.

References ILIAS\Setup\ArrayEnvironment\$resources.

38  {
39  $this->resources = $resources;
40  }

Member Function Documentation

◆ getConfigFor()

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

Exceptions

Implements ILIAS\Setup\Environment.

Definition at line 86 of file ArrayEnvironment.php.

87  {
88  if (!isset($this->configs[$component])) {
89  throw new \RuntimeException(
90  "Config for '$component' is not contained in the environment"
91  );
92  }
93  return $this->configs[$component];
94  }

◆ 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 45 of file ArrayEnvironment.php.

References $id.

46  {
47  if (!isset($this->resources[$id])) {
48  return null;
49  }
50  return $this->resources[$id];
51  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ hasConfigFor()

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

Implements ILIAS\Setup\Environment.

Definition at line 99 of file ArrayEnvironment.php.

99  : bool
100  {
101  return isset($this->configs[$component]);
102  }

◆ 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 71 of file ArrayEnvironment.php.

References $config.

71  : Environment
72  {
73  if (isset($this->configs[$component])) {
74  throw new \RuntimeException(
75  "Config for '$component' is already contained in the environment"
76  );
77  }
78  $clone = clone $this;
79  $clone->configs[$component] = $config;
80  return $clone;
81  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

◆ withResource()

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

Exceptions

Implements ILIAS\Setup\Environment.

Definition at line 56 of file ArrayEnvironment.php.

References $id.

56  : Environment
57  {
58  if (isset($this->resources[$id])) {
59  throw new \RuntimeException(
60  "Resource '$id' is already contained in the environment"
61  );
62  }
63  $clone = clone $this;
64  $clone->resources[$id] = $resource;
65  return $clone;
66  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

Field Documentation

◆ $configs

array ILIAS\Setup\ArrayEnvironment::$configs
protected

Definition at line 35 of file ArrayEnvironment.php.

◆ $resources

array ILIAS\Setup\ArrayEnvironment::$resources
protected

Definition at line 30 of file ArrayEnvironment.php.

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


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