cvs: pear /I18Nv2 I18Nv2.php

From: Date: Thu, 03 Mar 2005 15:30:47 +0000
Subject: cvs: pear /I18Nv2 I18Nv2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-30019@lists.php.net to get a copy of this message
mike Thu Mar 3 10:30:47 2005 EDT Modified files: /pear/I18Nv2 I18Nv2.php Log: * make fetching and destroying of already running ob optional for autoConv() http://cvs.php.net/diff.php/pear/I18Nv2/I18Nv2.php?r1=1.29&r2=1.30&ty=u Index: pear/I18Nv2/I18Nv2.php diff -u pear/I18Nv2/I18Nv2.php:1.29 pear/I18Nv2/I18Nv2.php:1.30 --- pear/I18Nv2/I18Nv2.php:1.29 Mon Feb 21 08:44:04 2005 +++ pear/I18Nv2/I18Nv2.php Thu Mar 3 10:30:45 2005 @@ -11,7 +11,7 @@ // | Copyright (c) 2004 Michael Wallner <mike@iworks.at> | // +----------------------------------------------------------------------+ // -// $Id: I18Nv2.php,v 1.29 2005/02/21 13:44:04 mike Exp $ +// $Id: I18Nv2.php,v 1.30 2005/03/03 15:30:45 mike Exp $ /** * I18Nv2 @@ -26,7 +26,7 @@ * I18Nv2 - Internationalization v2 * * @author Michael Wallner <mike@php.net> - * @version $Revision: 1.29 $ + * @version $Revision: 1.30 $ * @package I18Nv2 * @access public * @static @@ -202,7 +202,8 @@ * This method utilizes ob_iconv_handler(), so you should call it at the * beginning of your script (prior to output). If any output buffering has * been started before, the contents will be fetched with ob_get_contents() - * and the buffers will be destroyed by ob_end_clean(). + * and the buffers will be destroyed by ob_end_clean() if $refetchOB is set + * to true. * * <code> * require_once('I18Nv2.php'); @@ -219,8 +220,13 @@ * @param string $ie internal encoding * @param bool $decodeRequest whether to decode request variables * ($_GET and $_POST) from $oe to $ie + * @param bool $refetchOB whether contents of already active + * output buffers should be fetched, the + * output buffer handlers destroyed and + * the fetched data be passed through + * ob_iconvhandler */ - function autoConv($oe = 'UTF-8', $ie = 'ISO-8859-1', $decodeRequest = true) + function autoConv($oe = 'UTF-8', $ie = 'ISO-8859-1', $decodeRequest = true, $refetchOB = true) { if (!strcasecmp($oe, $ie)) { return true; @@ -238,7 +244,7 @@ iconv_set_encoding('input_encoding', $oe); $buffer = ''; - if ($level = ob_get_level()) { + if ($refetchOB && $level = ob_get_level()) { while ($level--) { $buffer .= ob_get_contents(); ob_end_clean();

« previous php.pear.cvs (#30019) next »