summaryrefslogtreecommitdiff
path: root/src/sp_var_value.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_var_value.c')
-rw-r--r--src/sp_var_value.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sp_var_value.c b/src/sp_var_value.c
index b9ac357..e351446 100644
--- a/src/sp_var_value.c
+++ b/src/sp_var_value.c
@@ -1,6 +1,7 @@
1#include "php_snuffleupagus.h" 1#include "php_snuffleupagus.h"
2 2
3static zval *get_param_var(zend_execute_data *ed, const char *var_name) { 3static zval *get_param_var(zend_execute_data *ed, const char *var_name,
4 bool print) {
4 unsigned int nb_param = ed->func->common.num_args; 5 unsigned int nb_param = ed->func->common.num_args;
5 6
6 for (unsigned int i = 0; i < nb_param; i++) { 7 for (unsigned int i = 0; i < nb_param; i++) {
@@ -13,6 +14,9 @@ static zval *get_param_var(zend_execute_data *ed, const char *var_name) {
13 if (0 == strcmp(arg_name, var_name)) { 14 if (0 == strcmp(arg_name, var_name)) {
14 return ZEND_CALL_VAR_NUM(ed, i); 15 return ZEND_CALL_VAR_NUM(ed, i);
15 } 16 }
17 if (print == true) {
18 sp_log_warn("config", " - %d parameter's name: '%s'", i, arg_name);
19 }
16 } 20 }
17 return NULL; 21 return NULL;
18} 22}
@@ -68,7 +72,7 @@ static zval *get_var_value(zend_execute_data *ed, const char *var_name,
68 } 72 }
69 73
70 if (is_param) { 74 if (is_param) {
71 zval *zvalue = get_param_var(ed, var_name); 75 zval *zvalue = get_param_var(ed, var_name, false);
72 if (!zvalue) { 76 if (!zvalue) {
73 char *complete_function_path = get_complete_function_path(ed); 77 char *complete_function_path = get_complete_function_path(ed);
74 sp_log_warn("config", 78 sp_log_warn("config",
@@ -76,6 +80,7 @@ static zval *get_var_value(zend_execute_data *ed, const char *var_name,
76 "'%s' of the function '%s', but the parameter does " 80 "'%s' of the function '%s', but the parameter does "
77 "not exists.", 81 "not exists.",
78 var_name, complete_function_path); 82 var_name, complete_function_path);
83 get_param_var(ed, var_name, true);
79 efree(complete_function_path); 84 efree(complete_function_path);
80 return NULL; 85 return NULL;
81 } 86 }