cvs: php4 / php.ini-dist php.ini-recommended /ext/zlib zlib.c

From: Date: Sat, 27 Oct 2001 05:22:20 +0000
Subject: cvs: php4 / php.ini-dist php.ini-recommended /ext/zlib zlib.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7987@lists.php.net to get a copy of this message
sniper Sat Oct 27 01:22:20 2001 EDT Modified files: /php4 php.ini-dist php.ini-recommended /php4/ext/zlib zlib.c Log: - Prevent PHP from starting if output_handler is set and zlib.output_compression is on - Added notes to the bundled php.ini files about this. Index: php4/php.ini-dist diff -u php4/php.ini-dist:1.98 php4/php.ini-dist:1.99 --- php4/php.ini-dist:1.98 Thu Oct 18 04:53:08 2001 +++ php4/php.ini-dist Sat Oct 27 01:22:19 2001 @@ -97,6 +97,9 @@ ; Transparent output compression using the zlib library ; Valid values for this option are 'off', 'on', or a specific buffer size ; to be used for compression (default is 4KB) +; +; Note: output_handler must be empty if this is set 'On' !!!! +; zlib.output_compression = Off ; Implicit flush tells PHP to tell the output layer to flush itself Index: php4/php.ini-recommended diff -u php4/php.ini-recommended:1.55 php4/php.ini-recommended:1.56 --- php4/php.ini-recommended:1.55 Thu Oct 18 04:53:08 2001 +++ php4/php.ini-recommended Sat Oct 27 01:22:19 2001 @@ -110,6 +110,9 @@ ; Transparent output compression using the zlib library ; Valid values for this option are 'off', 'on', or a specific buffer size ; to be used for compression (default is 4KB) +; +; Note: output_handler must be empty if this is set 'On' !!!! +; zlib.output_compression = Off ; Implicit flush tells PHP to tell the output layer to flush itself Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.99 php4/ext/zlib/zlib.c:1.100 --- php4/ext/zlib/zlib.c:1.99 Thu Oct 11 19:33:56 2001 +++ php4/ext/zlib/zlib.c Sat Oct 27 01:22:19 2001 @@ -18,7 +18,7 @@ | Jade Nicoletti <nicoletti@nns.ch> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.99 2001/10/11 23:33:56 ssb Exp $ */ +/* $Id: zlib.c,v 1.100 2001/10/27 05:22:19 sniper Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -131,8 +131,27 @@ ZEND_GET_MODULE(php_zlib) #endif +/* {{{ OnUpdate_zlib_output_compression */ +static PHP_INI_MH(OnUpdate_zlib_output_compression) +{ + char *ini_value; + + ini_value = php_ini_string("output_handler", sizeof("output_handler"), 0); + + if (new_value != NULL && strlen(ini_value) != 0) { + php_error(E_CORE_ERROR,"Cannot use both zlib.output_compression and output_handler!!"); + return FAILURE; + } + + OnUpdateInt(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + + return SUCCESS; +} +/* }}} */ + + PHP_INI_BEGIN() - STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdateInt, output_compression, zend_zlib_globals, zlib_globals) + STD_PHP_INI_BOOLEAN("zlib.output_compression", "0", PHP_INI_ALL, OnUpdate_zlib_output_compression, output_compression, zend_zlib_globals, zlib_globals) PHP_INI_END() /* {{{ phpi_destructor_gzclose

« previous php.cvs (#7987) next »