PHP_FE(ob_clean, NULL)
PHP_FE(ob_end_flush, NULL)
PHP_FE(ob_end_clean, NULL)
+ PHP_FE(ob_get_flush, NULL)
+ PHP_FE(ob_get_clean, NULL)
PHP_FE(ob_get_length, NULL)
PHP_FE(ob_get_level, NULL)
PHP_FE(ob_get_status, NULL)
}
/* }}} */
+/* {{{ proto bool ob_get_flush(void)
+ Get current buffer contents, flush (send) the output buffer, and delete current output buffer */
+PHP_FUNCTION(ob_get_flush)
+{
+ if (ZEND_NUM_ARGS() != 0)
+ WRONG_PARAM_COUNT;
+
+ /* get contents */
+ if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) {
+ RETURN_FALSE;
+ }
+ /* error checks */
+ if (!OG(ob_nesting_level)) {
+ php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete and flush buffer. No buffer to delete or flush.");
+ RETURN_FALSE;
+ }
+ if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) {
+ php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name);
+ RETURN_FALSE;
+ }
+ /* flush */
+ php_end_ob_buffer(1, 0 TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ proto bool ob_get_clean(void)
+ Get current buffer contents and delete current output buffer */
+PHP_FUNCTION(ob_get_clean)
+{
+ if (ZEND_NUM_ARGS() != 0)
+ WRONG_PARAM_COUNT;
+
+ /* get contents */
+ if (php_ob_get_buffer(return_value TSRMLS_CC)==FAILURE) {
+ RETURN_FALSE;
+ }
+ /* error checks */
+ if (!OG(ob_nesting_level)) {
+ php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer. No buffer to delete.");
+ RETURN_FALSE;
+ }
+ if (OG(ob_nesting_level) && !OG(active_ob_buffer).status && !OG(active_ob_buffer).erase) {
+ php_error_docref("ref.outcontrol" TSRMLS_CC, E_NOTICE, "failed to delete buffer %s.", OG(active_ob_buffer).handler_name);
+ RETURN_FALSE;
+ }
+ /* delete buffer */
+ php_end_ob_buffer(0, 0 TSRMLS_CC);
+}
+/* }}} */
+
/* {{{ proto string ob_get_contents(void)
Return the contents of the output buffer */
PHP_FUNCTION(ob_get_contents)
PHP_FUNCTION(ob_clean);
PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
+PHP_FUNCTION(ob_get_flush);
+PHP_FUNCTION(ob_get_clean);
PHP_FUNCTION(ob_get_contents);
PHP_FUNCTION(ob_get_length);
PHP_FUNCTION(ob_get_level);