summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2000-01-13 17:54:51 +0000
committerZeev Suraski <zeev@php.net>2000-01-13 17:54:51 +0000
commit3f74baed0291e746d9b8da208d30a4f32b741504 (patch)
tree6f7c22a8a2b02ccb88a3e0a1419d7d59f92ca3f4
parent972631be7105a3120a405dc0d25c2dbb7179cd13 (diff)
downloadphp-git-3f74baed0291e746d9b8da208d30a4f32b741504.tar.gz
Woops, forgot to commit the right version of the file...
-rw-r--r--ext/standard/output.c17
-rw-r--r--main/output.c17
2 files changed, 32 insertions, 2 deletions
diff --git a/ext/standard/output.c b/ext/standard/output.c
index 5ba4c92831..1679a4491f 100644
--- a/ext/standard/output.c
+++ b/ext/standard/output.c
@@ -67,6 +67,7 @@ PHP_FUNCTION(ob_start);
PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
PHP_FUNCTION(ob_get_contents);
+PHP_FUNCTION(ob_implicit_flush);
static void php_output_init_globals(OLS_D)
@@ -97,6 +98,7 @@ static zend_function_entry php_output_functions[] = {
PHP_FE(ob_end_flush, NULL)
PHP_FE(ob_end_clean, NULL)
PHP_FE(ob_get_contents, NULL)
+ PHP_FE(ob_implicit_flush, NULL)
{NULL, NULL, NULL}
};
@@ -184,13 +186,18 @@ PHPAPI void php_end_ob_buffering(int send_buffer)
PHPAPI void php_start_implicit_flush()
{
- php_end_ob_buffering(1); /* Switch out of output buffering if we're in it */
+ OLS_FETCH();
+ php_end_ob_buffering(1); /* Switch out of output buffering if we're in it */
+ OG(implicit_flush)=1;
}
PHPAPI void php_end_implicit_flush()
{
+ OLS_FETCH();
+
+ OG(implicit_flush)=0;
}
@@ -329,6 +336,9 @@ static int php_ub_body_write_no_header(const char *str, uint str_length)
free(newstr);
}
+ if (OG(implicit_flush)) {
+ sapi_flush();
+ }
return result;
}
@@ -400,6 +410,11 @@ PHP_FUNCTION(ob_implicit_flush)
flag = (*zv_flag)->value.lval;
break;
}
+ if (flag) {
+ php_start_implicit_flush();
+ } else {
+ php_end_implicit_flush();
+ }
}
diff --git a/main/output.c b/main/output.c
index 5ba4c92831..1679a4491f 100644
--- a/main/output.c
+++ b/main/output.c
@@ -67,6 +67,7 @@ PHP_FUNCTION(ob_start);
PHP_FUNCTION(ob_end_flush);
PHP_FUNCTION(ob_end_clean);
PHP_FUNCTION(ob_get_contents);
+PHP_FUNCTION(ob_implicit_flush);
static void php_output_init_globals(OLS_D)
@@ -97,6 +98,7 @@ static zend_function_entry php_output_functions[] = {
PHP_FE(ob_end_flush, NULL)
PHP_FE(ob_end_clean, NULL)
PHP_FE(ob_get_contents, NULL)
+ PHP_FE(ob_implicit_flush, NULL)
{NULL, NULL, NULL}
};
@@ -184,13 +186,18 @@ PHPAPI void php_end_ob_buffering(int send_buffer)
PHPAPI void php_start_implicit_flush()
{
- php_end_ob_buffering(1); /* Switch out of output buffering if we're in it */
+ OLS_FETCH();
+ php_end_ob_buffering(1); /* Switch out of output buffering if we're in it */
+ OG(implicit_flush)=1;
}
PHPAPI void php_end_implicit_flush()
{
+ OLS_FETCH();
+
+ OG(implicit_flush)=0;
}
@@ -329,6 +336,9 @@ static int php_ub_body_write_no_header(const char *str, uint str_length)
free(newstr);
}
+ if (OG(implicit_flush)) {
+ sapi_flush();
+ }
return result;
}
@@ -400,6 +410,11 @@ PHP_FUNCTION(ob_implicit_flush)
flag = (*zv_flag)->value.lval;
break;
}
+ if (flag) {
+ php_start_implicit_flush();
+ } else {
+ php_end_implicit_flush();
+ }
}