Skip to content

Commit

Permalink
Merge pull request #8533 from cakephp/phar-file-config
Browse files Browse the repository at this point in the history
Completing fix in FileConfigTrait to make phar files work
  • Loading branch information
markstory committed Mar 25, 2016
2 parents 625ca37 + 3fcca09 commit 9290327
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 9290327

Please sign in to comment.