From 9190271cefb74b308f1a7ca12fe5e9160d828dd7 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 30 Nov 2001 10:48:38 +0000 Subject: [PATCH] - Added ob_flush and ob_clean functions, which do not end the buffer like ob_end_flush and ob_end_clean do. @- Added ob_flush and ob_clean functions, which flush and clean an @ output buffer without destroying the buffer. (Derick) --- ext/standard/basic_functions.c | 2 ++ main/output.c | 16 ++++++++++++++++ main/php_output.h | 2 ++ 3 files changed, 20 insertions(+) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 923a187796..4d2d5f50e7 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -720,6 +720,8 @@ function_entry basic_functions[] = { /* functions from output.c */ PHP_FE(ob_start, NULL) + PHP_FE(ob_flush, NULL) + PHP_FE(ob_clean, NULL) PHP_FE(ob_end_flush, NULL) PHP_FE(ob_end_clean, NULL) PHP_FE(ob_get_length, NULL) diff --git a/main/output.c b/main/output.c index f03f15af23..92f2ef2d3d 100644 --- a/main/output.c +++ b/main/output.c @@ -533,6 +533,22 @@ PHP_FUNCTION(ob_start) } /* }}} */ +/* {{{ proto void ob_flush(void) + Flush (send) the output buffer */ +PHP_FUNCTION(ob_flush) +{ + php_end_ob_buffer(1, 1 TSRMLS_CC); +} +/* }}} */ + +/* {{{ proto void ob_clean(void) + Clean (erase) the output buffer */ +PHP_FUNCTION(ob_clean) +{ + php_end_ob_buffer(0, 1 TSRMLS_CC); +} +/* }}} */ + /* {{{ proto void ob_end_flush(void) Flush (send) the output buffer, and turn off output buffering */ PHP_FUNCTION(ob_end_flush) diff --git a/main/php_output.h b/main/php_output.h index f489532b0b..e8d1f2f7b0 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -43,6 +43,8 @@ PHPAPI int php_get_output_start_lineno(TSRMLS_D); PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size TSRMLS_DC); PHP_FUNCTION(ob_start); +PHP_FUNCTION(ob_flush); +PHP_FUNCTION(ob_clean); PHP_FUNCTION(ob_end_flush); PHP_FUNCTION(ob_end_clean); PHP_FUNCTION(ob_get_contents); -- 2.50.1