diff options
author | Derick Rethans <derick@php.net> | 2001-12-03 07:43:53 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2001-12-03 07:43:53 +0000 |
commit | 1f14640b3e756a6f5523b392bba8605bdf55d92d (patch) | |
tree | 6fc99252d414e0cf546f2cfb822f7620e19082d2 | |
parent | 03b5cb6775aeb4adf82d31a05be6d1034807d584 (diff) | |
download | php-git-1f14640b3e756a6f5523b392bba8605bdf55d92d.tar.gz |
- Added ob_get_level, which returns the nesting level of the output buffering
mechanism. (patch by Yasuo Ohgaki <yasuo_ohgaki@yahoo.com>)
@- Added ob_get_level, which returns the nesting level of the output buffering
@ mechanism. (Yasuo, Derick)
-rw-r--r-- | ext/standard/basic_functions.c | 1 | ||||
-rw-r--r-- | main/output.c | 8 | ||||
-rw-r--r-- | main/php_output.h | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 4d2d5f50e7..e31138f88d 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -725,6 +725,7 @@ function_entry basic_functions[] = { PHP_FE(ob_end_flush, NULL) PHP_FE(ob_end_clean, NULL) PHP_FE(ob_get_length, NULL) + PHP_FE(ob_get_level, NULL) PHP_FE(ob_get_contents, NULL) PHP_FE(ob_implicit_flush, NULL) diff --git a/main/output.c b/main/output.c index 92f2ef2d3d..80b9a0bb34 100644 --- a/main/output.c +++ b/main/output.c @@ -575,6 +575,14 @@ PHP_FUNCTION(ob_get_contents) } /* }}} */ +/* {{{ proto integer ob_get_level(void) + Return the nesting level of the output buffer */ +PHP_FUNCTION(ob_get_level) +{ + RETURN_LONG (OG(ob_nesting_level)); +} +/* }}} */ + /* {{{ proto string ob_get_length(void) Return the length of the output buffer */ PHP_FUNCTION(ob_get_length) diff --git a/main/php_output.h b/main/php_output.h index e8d1f2f7b0..191b0322b5 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -49,6 +49,7 @@ PHP_FUNCTION(ob_end_flush); PHP_FUNCTION(ob_end_clean); PHP_FUNCTION(ob_get_contents); PHP_FUNCTION(ob_get_length); +PHP_FUNCTION(ob_get_level); PHP_FUNCTION(ob_implicit_flush); typedef struct _php_ob_buffer { |