diff options
-rw-r--r-- | ext/standard/output.c | 8 | ||||
-rw-r--r-- | ext/standard/php_output.h | 1 | ||||
-rw-r--r-- | main/main.c | 1 | ||||
-rw-r--r-- | main/output.c | 8 | ||||
-rw-r--r-- | main/php_output.h | 1 |
5 files changed, 17 insertions, 2 deletions
diff --git a/ext/standard/output.c b/ext/standard/output.c index e484ea777c..1b4a656981 100644 --- a/ext/standard/output.c +++ b/ext/standard/output.c @@ -68,18 +68,24 @@ PHP_GINIT_FUNCTION(output) PHPAPI void php_output_startup() { OLS_FETCH(); - ELS_FETCH(); OG(php_body_write) = php_ub_body_write; OG(php_header_write) = sapi_module.ub_write; OG(nesting_level) = 0; OG(lock) = 0; +} + + +void php_output_register_constants() +{ + ELS_FETCH(); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); } + PHPAPI int php_body_write(const char *str, uint str_length) { OLS_FETCH(); diff --git a/ext/standard/php_output.h b/ext/standard/php_output.h index d7d617ba12..1792d20257 100644 --- a/ext/standard/php_output.h +++ b/ext/standard/php_output.h @@ -24,6 +24,7 @@ #include "php.h" PHPAPI void php_output_startup(void); +void php_output_register_constants(void); PHPAPI int php_body_write(const char *str, uint str_length); PHPAPI int php_header_write(const char *str, uint str_length); PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size); diff --git a/main/main.c b/main/main.c index 00fbbd0c9a..4fb2c9a45d 100644 --- a/main/main.c +++ b/main/main.c @@ -850,6 +850,7 @@ int php_module_startup(sapi_module_struct *sf) REGISTER_MAIN_STRINGL_CONSTANT("PHP_VERSION", PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT("PHP_OS", php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); + php_output_register_constants(); if (php_startup_ticks(PLS_C) == FAILURE) { php_printf("Unable to start PHP ticks\n"); diff --git a/main/output.c b/main/output.c index e484ea777c..1b4a656981 100644 --- a/main/output.c +++ b/main/output.c @@ -68,18 +68,24 @@ PHP_GINIT_FUNCTION(output) PHPAPI void php_output_startup() { OLS_FETCH(); - ELS_FETCH(); OG(php_body_write) = php_ub_body_write; OG(php_header_write) = sapi_module.ub_write; OG(nesting_level) = 0; OG(lock) = 0; +} + + +void php_output_register_constants() +{ + ELS_FETCH(); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_START", PHP_OUTPUT_HANDLER_START, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_CONT", PHP_OUTPUT_HANDLER_CONT, CONST_CS | CONST_PERSISTENT); REGISTER_MAIN_LONG_CONSTANT("PHP_OUTPUT_HANDLER_END", PHP_OUTPUT_HANDLER_END, CONST_CS | CONST_PERSISTENT); } + PHPAPI int php_body_write(const char *str, uint str_length) { OLS_FETCH(); diff --git a/main/php_output.h b/main/php_output.h index d7d617ba12..1792d20257 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -24,6 +24,7 @@ #include "php.h" PHPAPI void php_output_startup(void); +void php_output_register_constants(void); PHPAPI int php_body_write(const char *str, uint str_length); PHPAPI int php_header_write(const char *str, uint str_length); PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size); |