php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
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');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

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: Sun Dec 22 03:01:28 2024 UTC