[PHP-DOC] Bug #15930 Updated: gzencode can't have a level

2002-03-07 Thread jbgagnon

 ID:   15930
 Updated by:   [EMAIL PROTECTED]
-Summary:  gzencode can't have a level
 Reported By:  [EMAIL PROTECTED]
 Status:   Analyzed
 Bug Type: Documentation problem
-Operating System: windows 200
+Operating System: windows 2000
 PHP Version:  4.1.1
 Assigned To:  sr
 New Comment:

YES, I use it. before I use gzopen($fic,wb9); with a temporary file
the compression was better than gzencode.
For passing information from serveur to client, the size of data is
very important. I prefer spending 20 ms for much compression than 30
sec more for download.
but if it is possible to change the Z_DEFAULT_COMPRESSION,
it's ok I always use the same (maxi) compression.


Previous Comments:


[2002-03-07 10:50:54] [EMAIL PROTECTED]

That's an error in the documentation.

The optional second parameter doesn't set the compression level, it
does set the compression mode, i.e. you can use FORCE_GZIP or
FORCE_DEFLATE in order to use gzip/deflate compression. The compression
level is always the default Z_DEFAULT_COMPRESSION.

If nobody objects (does anybody use this parameter?) I'll fix the
documentation ...




[2002-03-07 07:37:05] [EMAIL PROTECTED]

?php
$data =
;
$gzdata = gzencode($data);
echo strlen($gzdata),:okBR;
$gzdata = gzencode($data,9);
echo strlen($gzdata),:bad always 10BR;
?




-- 
Edit this bug report at http://bugs.php.net/?id=15930edit=1




[PHP-DOC] Bug #15930 Updated: gzencode can't have a level

2002-03-07 Thread jbgagnon

 ID:   15930
 Updated by:   [EMAIL PROTECTED]
-Summary:  gzencode can't have a level
 Reported By:  [EMAIL PROTECTED]
 Status:   Analyzed
 Bug Type: Documentation problem
 Operating System: windows 2000
 PHP Version:  4.1.1
 Assigned To:  sr
 New Comment:

Well, I prefer the fonctionnality in documentation
or something like : gzencode($data[,$level[,$mode]])

It would be much easy to use, than make a gzip by hand with header,crc,
...

in User Contributed Notes two another persons report this problem. We
can perhaps ask them.


Previous Comments:


[2002-03-07 12:42:03] [EMAIL PROTECTED]

Z_DEFAULT_COMPRESSION is a constant of the zlib include file, so you
could change it only with a recompile of php.

As a workaround maybe you can use gzdeflate() or gzcompress(), there
the second parameter is the compression level. But then you have to
manually add the gzip headers (and maybe the CRC) if you need them.



[2002-03-07 11:41:43] [EMAIL PROTECTED]

YES, I use it. before I use gzopen($fic,wb9); with a temporary file
the compression was better than gzencode.
For passing information from serveur to client, the size of data is
very important. I prefer spending 20 ms for much compression than 30
sec more for download.
but if it is possible to change the Z_DEFAULT_COMPRESSION,
it's ok I always use the same (maxi) compression.



[2002-03-07 10:50:54] [EMAIL PROTECTED]

That's an error in the documentation.

The optional second parameter doesn't set the compression level, it
does set the compression mode, i.e. you can use FORCE_GZIP or
FORCE_DEFLATE in order to use gzip/deflate compression. The compression
level is always the default Z_DEFAULT_COMPRESSION.

If nobody objects (does anybody use this parameter?) I'll fix the
documentation ...




[2002-03-07 07:37:05] [EMAIL PROTECTED]

?php
$data =
;
$gzdata = gzencode($data);
echo strlen($gzdata),:okBR;
$gzdata = gzencode($data,9);
echo strlen($gzdata),:bad always 10BR;
?




-- 
Edit this bug report at http://bugs.php.net/?id=15930edit=1