diff options
| author | xXx-caillou-xXx | 2018-08-30 15:02:22 +0200 |
|---|---|---|
| committer | jvoisin | 2018-08-30 13:02:22 +0000 |
| commit | b3f67a16094168cc334f5da93a86f09476e01601 (patch) | |
| tree | de533b00c850ba1b64173a1d777f366a12f098df /src/tests/broken_conf_allow_broken_enabled.phpt | |
| parent | f61a4772bfc33e08e7b06250e2f0f640bcae875f (diff) | |
Change how we're handling invalid configurations
Since our configuration format is a bit more complex than php's one,
we have a `sp.allow_broken_configuration` parameter (`false` by default),
that you can set to `true` if you want PHP to carry on if your Snuffleupagus'
configuration contains syntax errors. You'll still get a big scary message in
your logs of course. We do **not** recommend to use it of course, but sometimes
it might be useful to be able to "debug in production" without breaking your
website.
Diffstat (limited to 'src/tests/broken_conf_allow_broken_enabled.phpt')
| -rw-r--r-- | src/tests/broken_conf_allow_broken_enabled.phpt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/broken_conf_allow_broken_enabled.phpt b/src/tests/broken_conf_allow_broken_enabled.phpt new file mode 100644 index 0000000..452595b --- /dev/null +++ b/src/tests/broken_conf_allow_broken_enabled.phpt | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | --TEST-- | ||
| 2 | Broken configuration with allow broken turned on | ||
| 3 | --SKIPIF-- | ||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | ||
| 5 | --INI-- | ||
| 6 | sp.configuration_file={PWD}/config/broken_conf.ini | ||
| 7 | sp.allow_broken_configuration=On | ||
| 8 | --FILE-- | ||
| 9 | <?php | ||
| 10 | echo 1337; | ||
| 11 | ?> | ||
| 12 | --EXPECT-- | ||
| 13 | PHP Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 | ||
| 14 | |||
| 15 | Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 | ||
| 16 | 1337 | ||
