PHP_FE(ob_start, NULL)
PHP_FE(ob_end_flush, NULL)
PHP_FE(ob_end_clean, NULL)
+ PHP_FE(ob_get_length, NULL)
PHP_FE(ob_get_contents, NULL)
PHP_FE(ob_implicit_flush, NULL)
}
+/* Return the size of the current output buffer */
+int php_ob_get_length(pval *p)
+{
+ OLS_FETCH();
+
+ if (OG(nesting_level) == 0) {
+ return FAILURE;
+ }
+ p->type = IS_LONG;
+ p->value.lval = OG(active_ob_buffer).text_length;
+ return SUCCESS;
+}
+
/*
* Wrapper functions - implementation
*/
/* }}} */
+/* {{{ proto string ob_get_length(void)
+ Return the length of the output buffer */
+PHP_FUNCTION(ob_get_length)
+{
+ if (php_ob_get_length(return_value)==FAILURE) {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+
/* {{{ proto void ob_implicit_flush([int flag])
Turn implicit flush on/off and is equivalent to calling flush() after every output call */
PHP_FUNCTION(ob_implicit_flush)
PHPAPI void php_end_ob_buffer(int send_buffer);
PHPAPI void php_end_ob_buffers(int send_buffer);
PHPAPI int php_ob_get_buffer(pval *p);
+PHPAPI int php_ob_get_length(pval *p);
PHPAPI void php_start_implicit_flush(void);
PHPAPI void php_end_implicit_flush(void);
PHPAPI char *php_get_output_start_filename(void);
PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
PHP_FUNCTION(ob_get_contents);
+PHP_FUNCTION(ob_get_length);
PHP_FUNCTION(ob_implicit_flush);
PHP_GINIT_FUNCTION(output);
}
+/* Return the size of the current output buffer */
+int php_ob_get_length(pval *p)
+{
+ OLS_FETCH();
+
+ if (OG(nesting_level) == 0) {
+ return FAILURE;
+ }
+ p->type = IS_LONG;
+ p->value.lval = OG(active_ob_buffer).text_length;
+ return SUCCESS;
+}
+
/*
* Wrapper functions - implementation
*/
/* }}} */
+/* {{{ proto string ob_get_length(void)
+ Return the length of the output buffer */
+PHP_FUNCTION(ob_get_length)
+{
+ if (php_ob_get_length(return_value)==FAILURE) {
+ RETURN_FALSE;
+ }
+}
+/* }}} */
+
+
/* {{{ proto void ob_implicit_flush([int flag])
Turn implicit flush on/off and is equivalent to calling flush() after every output call */
PHP_FUNCTION(ob_implicit_flush)
PHPAPI void php_end_ob_buffer(int send_buffer);
PHPAPI void php_end_ob_buffers(int send_buffer);
PHPAPI int php_ob_get_buffer(pval *p);
+PHPAPI int php_ob_get_length(pval *p);
PHPAPI void php_start_implicit_flush(void);
PHPAPI void php_end_implicit_flush(void);
PHPAPI char *php_get_output_start_filename(void);
PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
PHP_FUNCTION(ob_get_contents);
+PHP_FUNCTION(ob_get_length);
PHP_FUNCTION(ob_implicit_flush);
PHP_GINIT_FUNCTION(output);