From f15b4c1e3070fcdbe40adbb0b0872bf392d109d0 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Tue, 20 Aug 2002 20:22:30 +0000 Subject: [PATCH] change to php_error_docref() #documentation about output relevant ini settings will be in ref.outcontrol --- ext/zlib/zlib.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index a44f5fea56..a38c71207e 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -138,7 +138,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression) ini_value = php_ini_string("output_handler", sizeof("output_handler"), 0); if (ini_value != NULL && strlen(ini_value) != 0 && new_value != NULL && strlen(new_value) != 0 ) { - php_error(E_CORE_ERROR,"Cannot use both zlib.output_compression and output_handler together!!"); + php_error_docref("ref.outcontrol" TSRMLS_CC, E_CORE_ERROR, "Cannot use both zlib.output_compression and output_handler together!!"); return FAILURE; } @@ -154,7 +154,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression) } if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error(E_WARNING, "Cannot change zlib.output_compression - headers already sent"); + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_compression - headers already sent"); return FAILURE; } @@ -177,7 +177,7 @@ static PHP_INI_MH(OnUpdate_zlib_output_compression_level) static PHP_INI_MH(OnUpdate_zlib_output_handler) { if (stage == PHP_INI_STAGE_RUNTIME && SG(headers_sent) && !SG(request_info).no_headers) { - php_error(E_WARNING, "Cannot change zlib.output_handler - headers already sent"); + php_error_docref("ref.outcontrol" TSRMLS_CC, E_WARNING, "Cannot change zlib.output_handler - headers already sent"); return FAILURE; } @@ -295,7 +295,7 @@ PHP_FUNCTION(gzfile) /* using a stream here is a bit more efficient (resource wise) than php_gzopen_wrapper */ stream = php_stream_gzopen(NULL, Z_STRVAL_PP(filename), "rb", use_include_path|ENFORCE_SAFE_MODE|REPORT_ERRORS, NULL, NULL STREAMS_CC TSRMLS_CC); if (stream == NULL) { - php_error(E_WARNING,"gzFile(\"%s\") - %s",Z_STRVAL_PP(filename),strerror(errno)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzFile(\"%s\") - %s", Z_STRVAL_PP(filename), strerror(errno)); RETURN_FALSE; } @@ -421,7 +421,7 @@ PHP_FUNCTION(gzcompress) convert_to_long_ex(zlimit); limit = Z_LVAL_PP(zlimit); if((limit<0)||(limit>9)) { - php_error(E_WARNING,"gzcompress: compression level must be within 0..9"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzcompress: compression level(%d) must be within 0..9", limit); RETURN_FALSE; } break; @@ -446,7 +446,7 @@ PHP_FUNCTION(gzcompress) RETURN_STRINGL(s2, l2, 0); } else { efree(s2); - php_error(E_WARNING,"gzcompress: %s",zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzcompress: %s", zError(status)); RETURN_FALSE; } } @@ -472,7 +472,7 @@ PHP_FUNCTION(gzuncompress) WRONG_PARAM_COUNT; convert_to_long_ex(zlimit); if(Z_LVAL_PP(zlimit)<=0) { - php_error(E_WARNING,"gzuncompress: length must be greater zero"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzuncompress: length must be greater zero"); RETURN_FALSE; } plength = Z_LVAL_PP(zlimit); @@ -503,7 +503,7 @@ PHP_FUNCTION(gzuncompress) RETURN_STRINGL(s2, length, 0); } else { efree(s2); - php_error(E_WARNING,"gzuncompress: %s",zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzuncompress: %s", zError(status)); RETURN_FALSE; } } @@ -530,7 +530,7 @@ PHP_FUNCTION(gzdeflate) convert_to_long_ex(zlimit); level = Z_LVAL_PP(zlimit); if((level<0)||(level>9)) { - php_error(E_WARNING,"gzdeflate: compression level must be within 0..9"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzdeflate: compression level(%d) must be within 0..9", level); RETURN_FALSE; } break; @@ -573,7 +573,7 @@ PHP_FUNCTION(gzdeflate) RETURN_STRINGL(s2, stream.total_out, 0); } else { efree(s2); - php_error(E_WARNING,"gzdeflate: %s",zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzdeflate: %s", zError(status)); RETURN_FALSE; } } @@ -600,7 +600,7 @@ PHP_FUNCTION(gzinflate) WRONG_PARAM_COUNT; convert_to_long_ex(zlimit); if(Z_LVAL_PP(zlimit)<=0) { - php_error(E_WARNING,"gzinflate: length must be greater zero"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzinflate: length must be greater zero"); RETURN_FALSE; } plength = Z_LVAL_PP(zlimit); @@ -655,7 +655,7 @@ PHP_FUNCTION(gzinflate) RETURN_STRINGL(s2, stream.total_out, 0); } else { efree(s2); - php_error(E_WARNING,"gzinflate: %s",zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzinflate: %s", zError(status)); RETURN_FALSE; } } @@ -799,12 +799,12 @@ PHP_FUNCTION(gzencode) } if((level<-1)||(level>9)) { - php_error(E_WARNING,"gzencode: compression level must be within -1..9"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzencode: compression level(%d) must be within -1..9", level); RETURN_FALSE; } if((coding!=CODING_GZIP)&&(coding!=CODING_DEFLATE)) { - php_error(E_WARNING,"gzencode: encoding mode must be FORCE_GZIP or FORCE_DEFLATE"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzencode: encoding mode must be FORCE_GZIP or FORCE_DEFLATE"); RETURN_FALSE; } @@ -836,14 +836,14 @@ PHP_FUNCTION(gzencode) -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY)) != Z_OK) { - php_error(E_WARNING,"gzencode: %s", zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzencode: %s", zError(status)); RETURN_FALSE; } break; case CODING_DEFLATE: if ((status = deflateInit(&stream, level)) != Z_OK) { - php_error(E_WARNING,"gzencode: %s", zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzencode: %s", zError(status)); RETURN_FALSE; } break; @@ -881,7 +881,7 @@ PHP_FUNCTION(gzencode) RETURN_STRINGL(s2, stream.total_out+GZIP_HEADER_LENGTH+(coding==CODING_GZIP?GZIP_FOOTER_LENGTH:0), 0); } else { efree(s2); - php_error(E_WARNING,"gzencode: %s",zError(status)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "gzencode: %s", zError(status)); RETURN_FALSE; } } -- 2.40.0