#32870 [Opn->Csd]: Setting "output_handler" does not work with custom functions
| From: | vrana@php.net | Date: | Fri, 29 Apr 2005 08:26:41 +0000 |
| Subject: | #32870 [Opn->Csd]: Setting "output_handler" does not work with custom functions | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969368093@lists.php.net to get a copy of this message | ||
ID: 32870
Updated by: vrana@php.net
Reported By: ng4rrjanbiah at rediffmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Windows XP
PHP Version: 5.0.4
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
"Only built-in functions can be used with this directive. For user
defined functions, use ob_start()."
Sniper, thanks for pointing on the right place for documenting.
Previous Comments:
------------------------------------------------------------------------
[2005-04-29 01:36:04] sniper@php.net
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.
------------------------------------------------------------------------
[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