summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.c5
-rw-r--r--main/output.c17
2 files changed, 12 insertions, 10 deletions
diff --git a/main/main.c b/main/main.c
index c79a97389e..b7110c9189 100644
--- a/main/main.c
+++ b/main/main.c
@@ -434,13 +434,13 @@ PHPAPI void php_error(int type, const char *format,...)
}
/* get include file name */
- if (PG(log_errors) || PG(display_errors)) {
+ if (PG(log_errors) || PG(display_errors) || (!module_initialized)) {
va_start(args, format);
size = vsnprintf(buffer, sizeof(buffer) - 1, format, args);
va_end(args);
buffer[sizeof(buffer) - 1] = 0;
- if (PG(log_errors)) {
+ if (PG(log_errors) || (!module_initialized)) {
char log_buffer[1024];
snprintf(log_buffer, 1024, "PHP %s: %s in %s on line %d", error_type_str, buffer, error_filename, error_lineno);
@@ -847,6 +847,7 @@ static void php_new_thread_end_handler(THREAD_T thread_id)
#ifdef ZTS
static void core_globals_ctor(php_core_globals *core_globals)
{
+ memset(core_globals,0,sizeof(*core_globals));
zend_hash_init(&core_globals->ht_fsock_keys, 0, NULL, NULL, 1);
zend_hash_init(&core_globals->ht_fsock_socks, 0, NULL, (int (*)(void *))php_msock_destroy, 1);
}
diff --git a/main/output.c b/main/output.c
index 0eecddb40f..6a25ab3761 100644
--- a/main/output.c
+++ b/main/output.c
@@ -81,7 +81,7 @@ static void php_output_init_globals(php_output_globals *output_globals)
#endif
-PHP_MINIT_FUNCTION(output)
+PHP_GINIT_FUNCTION(output)
{
#ifdef ZTS
output_globals_id = ts_allocate_id(sizeof(php_output_globals), NULL, NULL);
@@ -111,15 +111,16 @@ PHP_RSHUTDOWN_FUNCTION(output);
php3_module_entry output_module_entry = {
"PHP_output",
php_output_functions,
- PHP_MINIT(output), /* extension-wide startup function */
- NULL, /* extension-wide shutdown function */
- PHP_RINIT(output), /* per-request startup function */
- PHP_RSHUTDOWN(output), /* per-request shutdown function */
- NULL, /* information function */
- STANDARD_MODULE_PROPERTIES
+ NULL, /* extension-wide startup function */
+ NULL, /* extension-wide shutdown function */
+ PHP_RINIT(output), /* per-request startup function */
+ PHP_RSHUTDOWN(output), /* per-request shutdown function */
+ NULL, /* information function */
+ PHP_GINIT(output), /* global startup function */
+ NULL, /* global shutdown function */
+ STANDARD_MODULE_PROPERTIES_EX
};
-
PHP_RINIT_FUNCTION(output)
{
php_output_startup();