From 48df50444fe449c3ba0cb7ded2ed7bf76e57a435 Mon Sep 17 00:00:00 2001 From: blotus Date: Fri, 20 Oct 2017 11:23:18 +0200 Subject: Add support for multiple files in sp.configuration_file directive This should close (#45--- src/snuffleupagus.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/snuffleupagus.c') diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index 4f02065..01bc4f6 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c @@ -154,13 +154,21 @@ PHP_MINFO_FUNCTION(snuffleupagus) { static PHP_INI_MH(OnUpdateConfiguration) { TSRMLS_FETCH(); + char *config_file = NULL; + if (!new_value || !new_value->len) { return FAILURE; } - if (sp_parse_config(new_value->val) != SUCCESS) { + config_file = strtok(new_value->val, ","); + if (sp_parse_config(config_file) != SUCCESS) { return FAILURE; } + while ((config_file = strtok(NULL, ","))) { + if (sp_parse_config(config_file) != SUCCESS) { + return FAILURE; + } + } if (SNUFFLEUPAGUS_G(config).config_random->enable) { hook_rand(); -- cgit v1.3