ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

RuntimeException if this resource is already in the environment. More...

 
 withConfigFor (string $component, $config)
 Stores a config for some component in the environment.
Exceptions

RuntimeException if this config is already in the environment. More...

 
 getConfigFor (string $component)
 
Exceptions

RuntimeException if there is no config for the component

Returns
mixed
More...
 
 hasConfigFor (string $component)
 
 getResource (string $id)
 Consumers of this method should check if the result is what they expect, e.g. More...
 
 withResource (string $id, $resource)
 
 withConfigFor (string $component, $config)
 Stores a config for some component in the environment. More...
 
 getConfigFor (string $component)
 
 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, and ILIAS\Repository\resources().

+ Here is the call graph for this function:

Member Function Documentation

◆ getConfigFor()

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

Exceptions

RuntimeException if there is no config for the component

Returns
mixed

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.

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

References $id, and ILIAS\Repository\resources().

+ Here is the call graph for this function:

◆ 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

RuntimeException if this config is already in the environment.

Implements ILIAS\Setup\Environment.

Definition at line 71 of file ArrayEnvironment.php.

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 }

◆ withResource()

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

Exceptions

RuntimeException if this resource is already in the environment.

Implements ILIAS\Setup\Environment.

Definition at line 56 of file ArrayEnvironment.php.

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 }

References $id, and ILIAS\Repository\resources().

+ Here is the call graph for this function:

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: