|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-07-31 09:55 UTC] mike@php.net
-Status: Open
+Status: Feedback
-Package: Feature/Change Request
+Package: Zlib related
-Assigned To:
+Assigned To: mike
[2013-07-31 09:55 UTC] mike@php.net
[2013-07-31 10:40 UTC] nicolas dot grekas+php at gmail dot com
-Status: Feedback
+Status: Closed
[2013-07-31 10:40 UTC] nicolas dot grekas+php at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 23:00:01 2025 UTC |
Description: ------------ Hi, I would like to implement a fine tuned output compression mechanism, and I can't with any of the actual PHP function. Basically, what I want is a function that does exactly what ob_gzhandler does, but without sending the headers is sends. I've thought about two possibilities to enable this : - the first is to implement a generic way to manage the headers buffer, ie a way to delete a header, not just replace it. This is a very generic solution, and I think it would benefit to PHP in general. - the second would be to add an option, maybe a third parameter, to ob_gzhandler. What do you think of that ? At least, it would be worth for me. Maybe for others too ? Reproduce code: --------------- Here is an example of a simple thing that don't work, but could be interesting : <?php function my_obgz($buffer, $mode) { // This example miss some headers management, // but the basic idea is here. // And in fact, this headers managmement is impossible // with actual the PHP functions. $gz = ob_gzhandler($buffer, $mode); if ($mode == (PHP_OUTPUT_HANDLER_START | PHP_OUTPUT_HANDLER_END)) { if (strlen($gz) < strlen($buffer)) $buffer =& $gz; } else $buffer =& $gz; return $buffer; } ob_start('my_obgz');