diff options
| author | 2019-01-26 16:03:29 +0100 | |
|---|---|---|
| committer | 2019-01-26 16:03:29 +0100 | |
| commit | 8dcdde6251ae4dfc690b1a014488df125c5e5cdc (patch) | |
| tree | f5762ac9c76acf708a50534f081e558489ccad86 /lib/Minz/Configuration.php | |
| parent | f0a359619fa2936d66a2b96dd086d4686e7405fa (diff) | |
| parent | 38e8e265e0f2ead830aa12e7ef81de12599405b5 (diff) | |
Merge pull request #2220 from FreshRSS/dev1.13.1
FreshRSS 1.13.1
Diffstat (limited to 'lib/Minz/Configuration.php')
| -rw-r--r-- | lib/Minz/Configuration.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php index 3e486d68e..aae3accc6 100644 --- a/lib/Minz/Configuration.php +++ b/lib/Minz/Configuration.php @@ -27,23 +27,16 @@ class Minz_Configuration { /** * Parse a file and return its data. * - * If the file does not contain a valid PHP code returning an array, an - * empty array is returned anyway. - * * @param $filename the name of the file to parse. * @return an array of values - * @throws Minz_FileNotExistException if the file does not exist. + * @throws Minz_FileNotExistException if the file does not exist or is invalid. */ public static function load($filename) { - if (!file_exists($filename)) { - throw new Minz_FileNotExistException($filename); - } - - $data = include($filename); + $data = @include($filename); if (is_array($data)) { return $data; } else { - return array(); + throw new Minz_FileNotExistException($filename); } } @@ -117,7 +110,7 @@ class Minz_Configuration { $this->default_filename = $default_filename; $this->_configurationSetter($configuration_setter); - if (!is_null($this->default_filename)) { + if ($this->default_filename != null) { $this->data = self::load($this->default_filename); } @@ -126,7 +119,7 @@ class Minz_Configuration { $this->data, self::load($this->config_filename) ); } catch (Minz_FileNotExistException $e) { - if (is_null($this->default_filename)) { + if ($this->default_filename == null) { throw $e; } } |
