|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #40324 Create a way to capture/unset headers sent by ob_gzhandler ?
Submitted: 2007-02-02 12:43 UTC Modified: 2013-07-31 10:40 UTC
From: nicolas dot grekas+php at gmail dot com Assigned: mike (profile)
Status: Closed Package: Zlib related
PHP Version: 5.2.0 OS: all
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nicolas dot grekas+php at gmail dot com
New email:
PHP Version: OS:


 [2007-02-02 12:43 UTC] nicolas dot grekas+php at gmail dot com

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 :


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 (strlen($gz) < strlen($buffer)) $buffer =& $gz;
    else $buffer =& $gz;

    return $buffer;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-31 09:55 UTC]
-Status: Open +Status: Feedback -Package: Feature/Change Request +Package: Zlib related -Assigned To: +Assigned To: mike
 [2013-07-31 09:55 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

 [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
Closing, not interesting, there are ways to work around
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 22 02:01:28 2024 UTC