Skip to content

Commit

Permalink
Completing fix in FileConfigTrait to make phar files work
Browse files Browse the repository at this point in the history
We have to return the actual file that was found. Otherwise we risk including files that are not there.
  • Loading branch information
lorenzo committed Mar 24, 2016
1 parent 625ca37 commit 85f9757
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Core/Configure/FileConfigTrait.php
Expand Up @@ -56,10 +56,14 @@ protected function _getFilePath($key, $checkExists = false)

$file .= $this->_extension;

if ($checkExists && !is_file($file) && !is_file(realpath($file))) {
throw new Exception(sprintf('Could not load configuration file: %s', $file));
if (!$checkExists || is_file($file)) {
return $file
}

return $file;
if (is_file(realpath($file))) {
return realpath($file);
}

throw new Exception(sprintf('Could not load configuration file: %s', $file));
}
}

0 comments on commit 85f9757

Please sign in to comment.