diff options
Diffstat (limited to 'src/snuffleupagus.c')
| -rw-r--r-- | src/snuffleupagus.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index d8a86b5..8c7ecbf 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c | |||
| @@ -13,6 +13,10 @@ | |||
| 13 | static PHP_INI_MH(OnUpdateConfiguration); | 13 | static PHP_INI_MH(OnUpdateConfiguration); |
| 14 | static inline void sp_op_array_handler(zend_op_array *op); | 14 | static inline void sp_op_array_handler(zend_op_array *op); |
| 15 | 15 | ||
| 16 | #ifdef SP_DEBUG_STDERR | ||
| 17 | int sp_debug_stderr = STDERR_FILENO; | ||
| 18 | #endif | ||
| 19 | |||
| 16 | ZEND_EXTENSION(); | 20 | ZEND_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 | ||
| 72 | static PHP_GINIT_FUNCTION(snuffleupagus) { | 76 | static PHP_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 @@ static PHP_GINIT_FUNCTION(snuffleupagus) { | |||
| 116 | } | 124 | } |
| 117 | 125 | ||
| 118 | PHP_MINIT_FUNCTION(snuffleupagus) { | 126 | PHP_MINIT_FUNCTION(snuffleupagus) { |
| 127 | sp_log_debug("(MINIT)"); | ||
| 119 | REGISTER_INI_ENTRIES(); | 128 | REGISTER_INI_ENTRIES(); |
| 120 | 129 | ||
| 121 | return SUCCESS; | 130 | return SUCCESS; |
| @@ -134,6 +143,7 @@ static inline void free_disabled_functions_hashtable(HashTable *const ht) { | |||
| 134 | } | 143 | } |
| 135 | 144 | ||
| 136 | static PHP_GSHUTDOWN_FUNCTION(snuffleupagus) { | 145 | static PHP_GSHUTDOWN_FUNCTION(snuffleupagus) { |
| 146 | sp_log_debug("(GSHUTDOWN)"); | ||
| 137 | #define FREE_HT(F) \ | 147 | #define FREE_HT(F) \ |
| 138 | zend_hash_destroy(snuffleupagus_globals->F); \ | 148 | zend_hash_destroy(snuffleupagus_globals->F); \ |
| 139 | pefree(snuffleupagus_globals->F, 1); | 149 | pefree(snuffleupagus_globals->F, 1); |
| @@ -188,6 +198,11 @@ static PHP_GSHUTDOWN_FUNCTION(snuffleupagus) { | |||
| 188 | FREE_CFG(config_disabled_functions_reg_ret); | 198 | FREE_CFG(config_disabled_functions_reg_ret); |
| 189 | #undef FREE_CFG | 199 | #undef FREE_CFG |
| 190 | #undef FREE_CFG_ZSTR | 200 | #undef FREE_CFG_ZSTR |
| 201 | |||
| 202 | #ifdef SP_DEBUG_STDERR | ||
| 203 | close(sp_debug_stderr); | ||
| 204 | sp_debug_stderr = STDERR_FILENO; | ||
| 205 | #endif | ||
| 191 | } | 206 | } |
| 192 | 207 | ||
| 193 | PHP_RINIT_FUNCTION(snuffleupagus) { | 208 | PHP_RINIT_FUNCTION(snuffleupagus) { |
| @@ -249,6 +264,8 @@ PHP_MINFO_FUNCTION(snuffleupagus) { | |||
| 249 | } | 264 | } |
| 250 | 265 | ||
| 251 | static PHP_INI_MH(OnUpdateConfiguration) { | 266 | static PHP_INI_MH(OnUpdateConfiguration) { |
| 267 | sp_log_debug("(OnUpdateConfiguration)"); | ||
| 268 | |||
| 252 | TSRMLS_FETCH(); | 269 | TSRMLS_FETCH(); |
| 253 | 270 | ||
| 254 | if (!new_value || !new_value->len) { | 271 | if (!new_value || !new_value->len) { |
