On 20 Apr 2005 06:42:27 -0700, "Diego Vilar" <di********@gmail.com> wrote:
When I set output_handler (either through php.ini our .htaccess) it
does not work with my custom funcions. Why is that?
Because they haven't been defined yet.
.htaccess:
will work:
php_value output_handler "ob_gzhandler"
ob_gzhandler is a PHP function. So it's already defined.
won't work:
php_value output_handler "fwk_output_handler"
fwk_output_handler is your custom function. Where is it defined? In a PHP
file? But PHP hasn't started reading any files yet, it's still parsing
configuration.
php.ini:
will work:
output_handler "ob_gzhandler"
won't work:
output_handler "fwk_output_handler"
I'm checking it through this script:
<?
var_dump(ob_list_handlers());
?>
and all I get is "array(0) { }" when trying to set the handler to any
function other than ob_gzhandler.
Any ideas?
(a) Use ob_start in whatever include file contains fwk_output_handler; the
function will then be defined since it's parsed the include file, so you can
use it as an output handler.
(b) Define fwk_output_handler in a PHP extension - this is likely to be more
pain than it's worth.
--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool