Show error message if config file is not readable

* when the config file is not writable there is a error message shown
* same happens now if the config file is not readable
* fixes #180
This commit is contained in:
Morris Jobke 2016-06-21 10:36:37 +02:00
parent b4df57f3f0
commit 191a6c65d9
No known key found for this signature in database
GPG key ID: 9CE5ED29E7FCD38A

View file

@ -184,10 +184,10 @@ class Config {
// Include file and merge config
foreach ($configFiles as $file) {
$filePointer = file_exists($file) ? fopen($file, 'r') : false;
$fileExistsAndIsReadable = file_exists($file) && is_readable($file);
$filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false;
if($file === $this->configFilePath &&
$filePointer === false &&
@!file_exists($this->configFilePath)) {
$filePointer === false) {
// Opening the main config might not be possible, e.g. if the wrong
// permissions are set (likely on a new installation)
continue;