Skip to content

Commit 13576b7

Browse files
committed
Updated to allow config to be retrieved.
1 parent 8d97088 commit 13576b7

2 files changed

Lines changed: 72 additions & 64 deletions

File tree

composer.lock

Lines changed: 50 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Configurator/Configurator.php

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ function addJSConfig($environment, $filename) {
9494
/**
9595
* @param $data
9696
*/
97-
private function addConfig($data) {
98-
$this->config = array_merge($this->config, $data);
99-
}
97+
// private function addConfig($data) {
98+
// $this->config = array_merge($this->config, $data);
99+
// }
100100

101101
private function addConfigDefault($data) {
102102
$this->configDefault = array_merge($this->configDefault, $data);
@@ -122,10 +122,13 @@ public function addPHPConfig($environment, $filename) {
122122
require($filename);
123123
$contents = ob_get_contents();
124124
ob_end_clean();
125+
125126

126127
if (strlen($contents) != 0) {
127128
echo "Filename `".$filename."` output some characters. Please check it is a valid PHP file.\n";
128129
}
130+
131+
//var_dump($default);
129132

130133
if (isset($default) == true) {
131134
$this->addConfigDefault($default);
@@ -174,10 +177,12 @@ public function addConfigValue($name, $value){
174177
* @return mixed
175178
*/
176179
public function configurate($inputFilename) {
177-
$config = $this->config;
178-
$config = array_merge($config, $this->configDefault);
179-
$config = array_merge($config, $this->configEnvironment);
180-
$config = array_merge($config, $this->configOverride);
180+
// $config = $this->config;
181+
// $config = array_merge($config, $this->configDefault);
182+
// $config = array_merge($config, $this->configEnvironment);
183+
// $config = array_merge($config, $this->configOverride);
184+
185+
$config = $this->getConfig();
181186

182187
foreach($config as $key => $value) {
183188
$$key = $value;
@@ -187,5 +192,15 @@ public function configurate($inputFilename) {
187192

188193
return $configuration;
189194
}
195+
196+
public function getConfig()
197+
{
198+
$config = $this->config;
199+
$config = array_merge($config, $this->configDefault);
200+
$config = array_merge($config, $this->configEnvironment);
201+
$config = array_merge($config, $this->configOverride);
202+
203+
return $config;
204+
}
190205
}
191206

0 commit comments

Comments
 (0)