Skip to content

Commit

Permalink
add getter to default environement
Browse files Browse the repository at this point in the history
  • Loading branch information
alfonsmartinez committed Jul 29, 2016
1 parent cbde24a commit c4c33df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ public function get($name)
if (isset($this->configs[$name])) {
return $this->configs[$name];
} elseif (strpos($name, '.') !== false) {

if (substr($name, 0, strlen('environment.')) == 'environment.') {
$name = str_replace('environment.', 'environments.' . $this->get('environment') . '.', $name);
return $this->get($name);
}

$loc = &$this->configs;
foreach (explode('.', $name) as $part) {
$loc = &$loc[$part];
Expand Down Expand Up @@ -100,6 +106,7 @@ public function shutdownFunction()

$this->handleError->parseError($errortypes[$error['type']], $error['type'], $error['message'],
$error['file'], $error['line']);

}
}

Expand Down

0 comments on commit c4c33df

Please sign in to comment.