]> granicus.if.org Git - php/commitdiff
- Prevent PHP from starting if output_handler is set and
authorfoobar <sniper@php.net>
Sat, 27 Oct 2001 05:22:19 +0000 (05:22 +0000)
committerfoobar <sniper@php.net>
Sat, 27 Oct 2001 05:22:19 +0000 (05:22 +0000)
  zlib.output_compression is on
- Added notes to the bundled php.ini files about this.

ext/zlib/zlib.c
php.ini-dist
php.ini-recommended

index 57fe6cf7119793a775736de728940e0c031b29ca..941d9f0da55c126f4fa7fdfd3957be06c5d0f0fa 100644 (file)
@@ -131,8 +131,27 @@ ZEND_DECLARE_MODULE_GLOBALS(zlib)
 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
index 798b4b25d691967f4d114b05ffaac4b8992c0fea..308f56f3582435fb844f7a03a1f639dc99cf9d41 100644 (file)
@@ -97,6 +97,9 @@ output_handler =
 ; 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 14d00fde473eaac2e2b58af6ccac44beef86df7f..36703bbaf29ec4bf3b2f3277b7c9f9dffd334a86 100644 (file)
@@ -110,6 +110,9 @@ output_handler =
 ; 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