#32870 [Opn]: Setting "output_handler" does not work with custom functions

From: Date: Thu, 28 Apr 2005 23:36:06 +0000
Subject: #32870 [Opn]: Setting "output_handler" does not work with custom functions
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969368079@lists.php.net to get a copy of this message
ID: 32870 Updated by: sniper@php.net Reported By: ng4rrjanbiah at rediffmail dot com Status: Open -Bug Type: Output Control +Bug Type: Documentation problem Operating System: Windows XP PHP Version: 5.0.4 New Comment: It won't work because the script is compiled and executed AFTER the automatic output buffering using the php.ini output_handler is started. Docteam: It should be noted here http://www.php.net/manual/en/ref.outcontrol.php in the configuration directives paragraph, section "output_handler", that you can only use the buildin output handler functions and not any user defined ones. Previous Comments: ------------------------------------------------------------------------ [2005-04-28 17:56:01] ng4rrjanbiah at rediffmail dot com Description: ------------ Setting output_handler (either through php.ini our .htaccess) does not work with custom functions. It works for "ob_gzhandler" but *not* on any custom functions--say "foo". There was a detail discussion on c.l.php about this http://groups.google.com/groups?as_umsgid=1114004547.490393.294850@z14g2000cwz.googlegroups.com Though we could set custom callback functions through ob_start(), we couldn't set output_handler (for custom functions) via php.ini. The manual also hints that it could be set PHP_INI_PERDIR basis http://in2.php.net/ref.outcontrol#AEN111555 Peace to you all PHP saints... -R. Rajesh Jeba Anbiah Reproduce code: --------------- in php.ini set: output_handler "foo_callback" in test.php: <?php function foo_callback($buffer) //callback defined { return $buffer; } print_r(ob_list_handlers()); ?> Expected result: ---------------- "foo_callback" to be listed Actual result: -------------- nothing. (Callback not registered.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32870&edit=1

« previous php.doc (#969368079) next »