Skip to content

Commit

Permalink
Self-hosted proxy due to Shields.io's abhorrent load times
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed May 25, 2018
1 parent bf449fa commit 9d57c14
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ Documentation: https://php.gt/docs/config
***

<a href="https://circleci.com/gh/PhpGt/Config" target="_blank">
<img src="https://img.shields.io/circleci/project/PhpGt/Config.svg?style=flat-square" alt="Build status" />
<img src="https://badge.status.php.gt/config-build.svg" alt="Build status" />
</a>
<a href="https://scrutinizer-ci.com/g/PhpGt/Config" target="_blank">
<img src="https://img.shields.io/scrutinizer/g/PhpGt/Config.svg?style=flat-square" alt="Code quality" />
<img src="https://badge.status.php.gt/config-quality.svg" alt="Code quality" />
</a>
<a href="https://scrutinizer-ci.com/g/PhpGt/Config" target="_blank">
<img src="https://img.shields.io/scrutinizer/coverage/g/PhpGt/Config.svg?style=flat-square" alt="Code coverage" />
<img src="https://badge.status.php.gt/config-coverage.svg" alt="Code coverage" />
</a>
<a href="https://packagist.org/packages/PhpGt/Config" target="_blank">
<img src="https://badge.status.php.gt/config-version.svg" alt="Current version" />
</a>
<a href="http://www.php.gt/config" target="_blank">
<img src="https://badge.status.php.gt/config-docs.svg" alt="PHP.Gt/Config documentation" />
</a>

## Example usage:
Expand Down
12 changes: 11 additions & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,17 @@ public function setDefault(
$filename
);

$this->kvp = array_merge($defaults, $this->kvp);
foreach($defaults as $section => $data) {
foreach($data as $key => $value) {
if(!isset($this->kvp[$section])) {
$this->kvp[$section] = [];
}

if(!isset($this->kvp[$section][$key])) {
$this->kvp[$section][$key] = $value;
}
}
}
}

public function get(string $name):?string {
Expand Down

0 comments on commit 9d57c14

Please sign in to comment.