cvs: php4 /ext/zlib zlib.c

From: Date: Tue, 20 Aug 2002 20:22:30 +0000
Subject: cvs: php4 /ext/zlib zlib.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13499@lists.php.net to get a copy of this message
helly Tue Aug 20 16:22:30 2002 EDT Modified files: /php4/ext/zlib zlib.c Log: change to php_error_docref() #documentation about output relevant ini settings will be in ref.outcontrol Index: php4/ext/zlib/zlib.c diff -u php4/ext/zlib/zlib.c:1.144 php4/ext/zlib/zlib.c:1.145 --- php4/ext/zlib/zlib.c:1.144 Tue Aug 20 15:51:00 2002 +++ php4/ext/zlib/zlib.c Tue Aug 20 16:22:30 2002 @@ -18,7 +18,7 @@ | Jade Nicoletti <nicoletti@nns.ch> | +----------------------------------------------------------------------+ */ -/* $Id: zlib.c,v 1.144 2002/08/20 19:51:00 helly Exp $ */ +/* $Id: zlib.c,v 1.145 2002/08/20 20:22:30 helly Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H @@ -138,7 +138,7 @@ 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 @@ } 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_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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ } 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 @@ -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 @@ 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; } }

« previous php.cvs (#13499) next »