diff options
| author | 2013-11-09 21:33:43 +0100 | |
|---|---|---|
| committer | 2013-11-09 21:33:43 +0100 | |
| commit | a1fa4a445ad6a8b12fe606764588b619edab8d8f (patch) | |
| tree | 27a24450906d0853ad28527e69f3d4a04ec0f666 /lib/minz/Configuration.php | |
| parent | 33b68a801734999504d3dfe811bb71582f7b9b0d (diff) | |
Ajout de messages en cas de mauvaise configuration
Si fichier de conf inaccessible / mal configuré ou fichier de log
inaccessible, on affiche des messages plus explicites qu'une page
blanche
Diffstat (limited to 'lib/minz/Configuration.php')
| -rwxr-xr-x | lib/minz/Configuration.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/minz/Configuration.php b/lib/minz/Configuration.php index ad6df1bcf..b296ec378 100755 --- a/lib/minz/Configuration.php +++ b/lib/minz/Configuration.php @@ -13,7 +13,7 @@ class Configuration { /** * VERSION est la version actuelle de MINZ */ - const VERSION = '1.3.1'; + const VERSION = '1.3.1.freshrss'; // version spéciale FreshRSS /** * valeurs possibles pour l'"environment" @@ -98,10 +98,10 @@ class Configuration { try { self::parseFile (); self::setReporting (); - } catch (BadConfigurationException $e) { - throw $e; } catch (FileNotExistException $e) { throw $e; + } catch (BadConfigurationException $e) { + throw $e; } } @@ -117,11 +117,19 @@ class Configuration { MinzException::ERROR ); } + $ini_array = parse_ini_file ( APP_PATH . self::CONF_PATH_NAME, true ); + if (!$ini_array) { + throw new PermissionDeniedException ( + APP_PATH . self::CONF_PATH_NAME, + MinzException::ERROR + ); + } + // [general] est obligatoire if (!isset ($ini_array['general'])) { throw new BadConfigurationException ( |
