summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorSammy Kaye Powers <sammyk@php.net>2020-10-02 15:19:07 -0700
committerSammy Kaye Powers <sammyk@php.net>2020-10-05 14:01:43 -0700
commita9e96a378db3e3e86b8b310ebbf5a20f909f67fb (patch)
tree0304d0e14e15bf796e286648c9710ecc2d7f9c90 /main
parent31f54586b5464c2232d2e628a816b85b663eb877 (diff)
downloadphp-git-a9e96a378db3e3e86b8b310ebbf5a20f909f67fb.tar.gz
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
Diffstat (limited to 'main')
-rw-r--r--main/main.c4
-rw-r--r--main/php.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/main/main.c b/main/main.c
index da510f5551..4511453dce 100644
--- a/main/main.c
+++ b/main/main.c
@@ -744,14 +744,14 @@ static int module_startup = 1;
static int module_shutdown = 0;
/* {{{ php_during_module_startup */
-static int php_during_module_startup(void)
+PHPAPI int php_during_module_startup(void)
{
return module_startup;
}
/* }}} */
/* {{{ php_during_module_shutdown */
-static int php_during_module_shutdown(void)
+PHPAPI int php_during_module_shutdown(void)
{
return module_shutdown;
}
diff --git a/main/php.h b/main/php.h
index a747a99499..f796577249 100644
--- a/main/php.h
+++ b/main/php.h
@@ -311,6 +311,8 @@ void phperror(char *error);
PHPAPI size_t php_write(void *buf, size_t size);
PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2);
PHPAPI size_t php_printf_unchecked(const char *format, ...);
+PHPAPI int php_during_module_startup(void);
+PHPAPI int php_during_module_shutdown(void);
PHPAPI int php_get_module_initialized(void);
#ifdef HAVE_SYSLOG_H
#include "php_syslog.h"