Skip to content

Commit

Permalink
Added sanity check for config.php.sample as it is needed to fill in d…
Browse files Browse the repository at this point in the history
…efault values. Code will now throw an error if missing.
  • Loading branch information
Auz committed Jul 29, 2015
1 parent 2496401 commit bb10fba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/PhpReports/PhpReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ public static function init($config = 'config/config.php') {
if(!file_exists($config)) {
throw new Exception("Cannot find config file");
}


// The config.php.sample is used to populate default values should the config.php be incomplete.
// As a result, we require it be there.
if(!file_exists('config/config.php.sample')) {
throw new Exception("Cannot find sample config. Please leave config/config.php.sample in place for default values.");
}

$default_config = include('config/config.php.sample');
$config = include($config);

Expand Down

0 comments on commit bb10fba

Please sign in to comment.