Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56815 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 29393 invoked from network); 6 Dec 2011 17:01:35 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Dec 2011 17:01:35 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicolas.grekas@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicolas.grekas@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: nicolas.grekas@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:41989] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4C/71-20173-E6A4EDE4 for ; Tue, 06 Dec 2011 12:01:35 -0500 Received: by yenl6 with SMTP id l6so616624yen.29 for ; Tue, 06 Dec 2011 09:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=GUI4Sr9sep7gl7EvqAZAlkU9Af7CAW7ehS/lJZrZwzU=; b=k8k18xmo39e8Dwq3AIGwpYHUpqwUFie5AusoBcsY4pwTlKUEz1yS37F9fgnJAk77lP 7Z1ffdwJPJjYnRQ4rl0ytQSNBZbuJJtU1uswRR1sp9y1Sv0jc/Uo9bBUrhxhdKWEowSW o0kSH4vOhqQVaVpYZiJot3fQISVh4g2ZfwXu8= Received: by 10.236.139.199 with SMTP id c47mr20537007yhj.113.1323190874230; Tue, 06 Dec 2011 09:01:14 -0800 (PST) MIME-Version: 1.0 Sender: nicolas.grekas@gmail.com Received: by 10.236.207.66 with HTTP; Tue, 6 Dec 2011 09:00:52 -0800 (PST) In-Reply-To: References: <4EC025B4.2070009@sugarcrm.com> <4EC17308.6030406@sugarcrm.com> Date: Tue, 6 Dec 2011 18:00:52 +0100 X-Google-Sender-Auth: YA33A8Mb4li2PGxQ04e91jfM3dM Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf303bfd2207506f04b36f62de Subject: Re: [PHP-DEV] function ob_gzhandler is missed in 5.4 From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --20cf303bfd2207506f04b36f62de Content-Type: text/plain; charset=ISO-8859-1 Hi, I don't want anyone to take it personal... But what is the status about missing ob_gzhandler function (but also ob_tidyhandler and ob_iconv_handler) ? I put mike's patch and a comment to help track the BC break /potential inconsistency : https://bugs.php.net/bug.php?id=60326 Regards Nicolas On Fri, Nov 18, 2011 at 12:46, Nicolas Grekas wrote: > Without a real ob_gzhandler function, replacing it with an alias as > currently in RC1 : what if someone then creates an ob_gzhandler function in > userland ? would ob_start('ob_gzhandler') use the userland function or > still the alias ? I think this is a second argument to make ob_gzhandler a > real function : least surprise. > > Personally, I do use ob_gzhandler directly because it's the easiest way to > do chunked compressed encoding in userland. > > This allows me to ask for compression as late as possible, because > registering an ob_start('ob_gzhandler'); may be too early for me. I do want > to choose to enable compression only when the very first byte is about to > be sent over the wire. > > Hope it helps > > Nicolas > > > function my_ob_handler($buffer, $mode) > { > // based on content-type, > // do some $buffer filtering > // and add some header() > > if (/* content-type benefits compression based on some userland rules */) > { > $buffer = ob_gzhandler($buffer, $mode); // benefits from gzip > negotiation, chunked compression and related headers > > if (PHP_OUTPUT_HANDLER_START & $mode) > { > // play/fix with Vary: header, as sent by ob_gzhandler or before > } > } > > return $buffer; > } > > --20cf303bfd2207506f04b36f62de--