Skip to content
This repository has been archived by the owner on Sep 6, 2020. It is now read-only.

Commit

Permalink
Adding detection of relative path use. (fixes #131)
Browse files Browse the repository at this point in the history
  • Loading branch information
kherge committed Mar 5, 2016
1 parent f8d6484 commit 69c1113
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/lib/KevinGH/Box/Helper/ConfigurationHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Herrera\Json\Json;
use KevinGH\Box\Configuration;
use Phine\Path\Path;
use RuntimeException;
use Symfony\Component\Console\Helper\Helper;

Expand Down Expand Up @@ -89,6 +90,15 @@ public function loadFile($file = null)
$json = $this->json->decodeFile($file);

if (isset($json->import)) {
if (!Path::isAbsolute($json->import)) {
$json->import = Path::join(
array(
dirname($file),
$json->import
)
);
}

$json = (object) array_merge(
(array) $this->json->decodeFile($json->import),
(array) $json
Expand Down

0 comments on commit 69c1113

Please sign in to comment.