summaryrefslogtreecommitdiff
path: root/src/snuffleupagus.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-08-14 18:44:26 +0200
committerjvoisin2021-08-14 18:44:26 +0200
commit76424299f8dd69990a7812474803fac9ec52b0b2 (patch)
tree14b6044cd13458466fa11dd17e09900451e31400 /src/snuffleupagus.c
parent741cab4456f4cf1b12ef40a616797115b547f7d2 (diff)
debug log to dup'd stderr / php is closing stderr during shutdown
Diffstat (limited to 'src/snuffleupagus.c')
-rw-r--r--src/snuffleupagus.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c
index 7bf3649..1ac04d0 100644
--- a/src/snuffleupagus.c
+++ b/src/snuffleupagus.c
@@ -13,6 +13,10 @@
13static PHP_INI_MH(OnUpdateConfiguration); 13static PHP_INI_MH(OnUpdateConfiguration);
14static inline void sp_op_array_handler(zend_op_array *op); 14static inline void sp_op_array_handler(zend_op_array *op);
15 15
16#ifdef SP_DEBUG_STDERR
17int sp_debug_stderr = STDERR_FILENO;
18#endif
19
16ZEND_EXTENSION(); 20ZEND_EXTENSION();
17 21
18// LCOV_EXCL_START 22// LCOV_EXCL_START
@@ -70,6 +74,10 @@ ZEND_DLEXPORT zend_extension zend_extension_entry = {
70 STANDARD_ZEND_EXTENSION_PROPERTIES}; 74 STANDARD_ZEND_EXTENSION_PROPERTIES};
71 75
72PHP_GINIT_FUNCTION(snuffleupagus) { 76PHP_GINIT_FUNCTION(snuffleupagus) {
77#ifdef SP_DEBUG_STDERR
78 sp_debug_stderr = dup(STDERR_FILENO);
79#endif
80 sp_log_debug("(GINIT)");
73 snuffleupagus_globals->is_config_valid = SP_CONFIG_NONE; 81 snuffleupagus_globals->is_config_valid = SP_CONFIG_NONE;
74 snuffleupagus_globals->in_eval = 0; 82 snuffleupagus_globals->in_eval = 0;
75 83
@@ -116,6 +124,7 @@ PHP_GINIT_FUNCTION(snuffleupagus) {
116} 124}
117 125
118PHP_MINIT_FUNCTION(snuffleupagus) { 126PHP_MINIT_FUNCTION(snuffleupagus) {
127 sp_log_debug("(MINIT)");
119 REGISTER_INI_ENTRIES(); 128 REGISTER_INI_ENTRIES();
120 129
121 return SUCCESS; 130 return SUCCESS;
@@ -244,6 +253,8 @@ PHP_MINFO_FUNCTION(snuffleupagus) {
244} 253}
245 254
246static PHP_INI_MH(OnUpdateConfiguration) { 255static PHP_INI_MH(OnUpdateConfiguration) {
256 sp_log_debug("(OnUpdateConfiguration)");
257
247 TSRMLS_FETCH(); 258 TSRMLS_FETCH();
248 259
249 if (!new_value || !new_value->len) { 260 if (!new_value || !new_value->len) {