From b3f67a16094168cc334f5da93a86f09476e01601 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Thu, 30 Aug 2018 15:02:22 +0200 Subject: 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.--- src/tests/broken_conf_allow_broken_enabled.phpt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/tests/broken_conf_allow_broken_enabled.phpt (limited to 'src/tests/broken_conf_allow_broken_enabled.phpt') 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 @@ +--TEST-- +Broken configuration with allow broken turned on +--SKIPIF-- + +--INI-- +sp.configuration_file={PWD}/config/broken_conf.ini +sp.allow_broken_configuration=On +--FILE-- + +--EXPECT-- +PHP Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 + +Fatal error: [snuffleupagus][config] Invalid configuration prefix for 'this is a broken line' on line 1 in Unknown on line 0 +1337 -- cgit v1.3