cvs: php4 /main main.c output.c php_globals.h
| From: | Zeev Suraski | Date: | Sat, 11 Aug 2001 22:55:00 +0000 |
| Subject: | cvs: php4 /main main.c output.c php_globals.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6747@lists.php.net to get a copy of this message | ||
zeev Sat Aug 11 18:55:00 2001 EDT
Modified files:
/php4/main main.c output.c php_globals.h
Log:
Make it possible to enable chunked output buffering without providing
an output handling function
Index: php4/main/main.c
diff -u php4/main/main.c:1.403 php4/main/main.c:1.404
--- php4/main/main.c:1.403 Wed Aug 8 16:05:37 2001
+++ php4/main/main.c Sat Aug 11 18:55:00 2001
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.403 2001/08/08 20:05:37 zeev Exp $ */
+/* $Id: main.c,v 1.404 2001/08/11 22:55:00 zeev Exp $ */
/* {{{ includes
*/
@@ -227,7 +227,7 @@
STD_PHP_INI_BOOLEAN("magic_quotes_gpc", "1", PHP_INI_ALL, OnUpdateBool, magic_quotes_gpc, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("magic_quotes_runtime", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_runtime, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("magic_quotes_sybase", "0", PHP_INI_ALL, OnUpdateBool, magic_quotes_sybase, php_core_globals, core_globals)
- STD_PHP_INI_BOOLEAN("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateBool, output_buffering, php_core_globals, core_globals)
+ STD_PHP_INI_ENTRY("output_buffering", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateInt, output_buffering, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("output_handler", NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM,OnUpdateString, output_handler, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_argc_argv", "1", PHP_INI_ALL, OnUpdateBool, register_argc_argv, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("register_globals", "1", PHP_INI_ALL, OnUpdateBool, register_globals, php_core_globals, core_globals)
@@ -669,7 +669,11 @@
Z_TYPE_P(output_handler) = IS_STRING;
php_start_ob_buffer(output_handler, 0 TSRMLS_CC);
} else if (PG(output_buffering)) {
- php_start_ob_buffer(NULL, 0 TSRMLS_CC);
+ if (PG(output_buffering)>1) {
+ php_start_ob_buffer(NULL, PG(output_buffering) TSRMLS_CC);
+ } else {
+ php_start_ob_buffer(NULL, 0 TSRMLS_CC);
+ }
} else if (PG(implicit_flush)) {
php_start_implicit_flush(TSRMLS_C);
}
Index: php4/main/output.c
diff -u php4/main/output.c:1.73 php4/main/output.c:1.74
--- php4/main/output.c:1.73 Sun Aug 5 11:55:43 2001
+++ php4/main/output.c Sat Aug 11 18:55:00 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.73 2001/08/05 15:55:43 sas Exp $ */
+/* $Id: output.c,v 1.74 2001/08/11 22:55:00 zeev Exp $ */
#include "php.h"
#include "ext/standard/head.h"
@@ -482,12 +482,11 @@
Turn on Output Buffering (specifying an optional output handler). */
PHP_FUNCTION(ob_start)
{
- zval *output_handler;
+ zval *output_handler=NULL;
uint chunk_size=0;
switch (ZEND_NUM_ARGS()) {
case 0:
- output_handler = NULL;
break;
case 1: {
zval **output_handler_p;
@@ -506,9 +505,11 @@
if (zend_get_parameters_ex(2, &output_handler_p, &chunk_size_p)==FAILURE) {
RETURN_FALSE;
}
- SEPARATE_ZVAL(output_handler_p);
- output_handler = *output_handler_p;
- output_handler->refcount++;
+ if (Z_STRLEN_PP(output_handler_p)>0) {
+ SEPARATE_ZVAL(output_handler_p);
+ output_handler = *output_handler_p;
+ output_handler->refcount++;
+ }
convert_to_long_ex(chunk_size_p);
chunk_size = (uint) Z_LVAL_PP(chunk_size_p);
}
Index: php4/main/php_globals.h
diff -u php4/main/php_globals.h:1.69 php4/main/php_globals.h:1.70
--- php4/main/php_globals.h:1.69 Sat Jul 28 07:36:28 2001
+++ php4/main/php_globals.h Sat Aug 11 18:55:00 2001
@@ -52,12 +52,13 @@
zend_bool magic_quotes_runtime;
zend_bool magic_quotes_sybase;
+ zend_bool safe_mode;
+
zend_bool allow_call_time_pass_reference;
- zend_bool zend_set_utility_values;
- zend_bool output_buffering;
zend_bool implicit_flush;
- zend_bool safe_mode;
+ int output_buffering;
+
char *safe_mode_include_dir;
zend_bool safe_mode_gid;
zend_bool sql_safe_mode;