]> granicus.if.org Git - php/commitdiff
- Added ob_flush and ob_clean functions, which do not end the buffer like
authorDerick Rethans <derick@php.net>
Fri, 30 Nov 2001 10:48:38 +0000 (10:48 +0000)
committerDerick Rethans <derick@php.net>
Fri, 30 Nov 2001 10:48:38 +0000 (10:48 +0000)
  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
main/output.c
main/php_output.h

index 923a18779612c90b059a20362c9ee1936faa415a..4d2d5f50e7a866983857270c94b1642984f00b81 100644 (file)
@@ -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)
index f03f15af2338eb6e4f5850a2fdf1a1af86f90bc0..92f2ef2d3dfcf3e2b8f0ff9f024ba69dbcccd54b 100644 (file)
@@ -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)
index f489532b0b80bef9973725defb8d9e5293dcca9d..e8d1f2f7b0550608583a4997b2a790842ded7c95 100644 (file)
@@ -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);