Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
DeploymentConfig Class Reference

Public Member Functions

 __construct (DeploymentConfig\Reader $reader, $overrideData=[])
 
 get ($key=null, $defaultValue=null)
 
 isAvailable ()
 
 getConfigData ($key=null)
 
 resetData ()
 
 isDbAvailable ()
 

Detailed Description

Application deployment configuration

@api

Since
100.0.2

Definition at line 17 of file DeploymentConfig.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( DeploymentConfig\Reader  $reader,
  $overrideData = [] 
)

Constructor

Data can be optionally injected in the constructor. This object's public interface is intentionally immutable

Parameters
DeploymentConfig\Reader$reader
array$overrideData

Definition at line 55 of file DeploymentConfig.php.

56  {
57  $this->reader = $reader;
58  $this->overrideData = $overrideData;
59  }

Member Function Documentation

◆ get()

get (   $key = null,
  $defaultValue = null 
)

Gets data from flattened data

Parameters
string$key
mixed$defaultValue
Returns
mixed|null

Definition at line 68 of file DeploymentConfig.php.

69  {
70  $this->load();
71  if ($key === null) {
72  return $this->flatData;
73  }
74  return $this->flatData[$key] ?? $defaultValue;
75  }

◆ getConfigData()

getConfigData (   $key = null)

Gets a value specified key from config data

Parameters
string$key
Returns
null|mixed

Definition at line 95 of file DeploymentConfig.php.

96  {
97  $this->load();
98 
99  if ($key !== null && !isset($this->data[$key])) {
100  return null;
101  }
102 
103  if (isset($this->data[$key])) {
104  return $this->data[$key];
105  }
106 
107  return $this->data;
108  }

◆ isAvailable()

isAvailable ( )

Checks if data available

Returns
bool

Definition at line 82 of file DeploymentConfig.php.

83  {
84  $this->data = null;
85  $this->load();
86  return isset($this->flatData[ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE]);
87  }

◆ isDbAvailable()

isDbAvailable ( )

Check if data from deploy files is available

Returns
bool
Since
100.1.3

Definition at line 126 of file DeploymentConfig.php.

127  {
128  $this->load();
129  return isset($this->data['db']);
130  }

◆ resetData()

resetData ( )

Resets config data

Returns
void

Definition at line 115 of file DeploymentConfig.php.

116  {
117  $this->data = null;
118  }

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