diff --git a/src/Core/Configure/FileConfigTrait.php b/src/Core/Configure/FileConfigTrait.php index 106b649703e..f695596fbde 100644 --- a/src/Core/Configure/FileConfigTrait.php +++ b/src/Core/Configure/FileConfigTrait.php @@ -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)); } }