Skip to content

Commit a9e96a3

Browse files
committed
Expose php_during_module_startup() and php_during_module_shutdown()
This can be handy when trying to determine if it is safe to access request globals amongst other things. Closes GH-6265
1 parent 31f5458 commit a9e96a3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -744,14 +744,14 @@ static int module_startup = 1;
744744
static int module_shutdown = 0;
745745

746746
/* {{{ php_during_module_startup */
747-
static int php_during_module_startup(void)
747+
PHPAPI int php_during_module_startup(void)
748748
{
749749
return module_startup;
750750
}
751751
/* }}} */
752752

753753
/* {{{ php_during_module_shutdown */
754-
static int php_during_module_shutdown(void)
754+
PHPAPI int php_during_module_shutdown(void)
755755
{
756756
return module_shutdown;
757757
}

main/php.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ void phperror(char *error);
311311
PHPAPI size_t php_write(void *buf, size_t size);
312312
PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
313313
PHPAPI size_t php_printf_unchecked(const char *format, ...);
314+
PHPAPI int php_during_module_startup(void);
315+
PHPAPI int php_during_module_shutdown(void);
314316
PHPAPI int php_get_module_initialized(void);
315317
#ifdef HAVE_SYSLOG_H
316318
#include "php_syslog.h"

0 commit comments

Comments
 (0)