cvs: pear /PEAR_PackageFileManager_Frontend Frontend.php

From: Date: Sun, 21 May 2006 10:28:13 +0000
Subject: cvs: pear /PEAR_PackageFileManager_Frontend Frontend.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-40254@lists.php.net to get a copy of this message
farell Sun May 21 10:28:13 2006 UTC Modified files: /pear/PEAR_PackageFileManager_Frontend Frontend.php Log: updates hack for PEAR::Config, and allow to parse correctly boolean for xml container all formats below are accepted: <tag>TRUE</tag> <tag>true</tag> <tag>1</tag> <tag>FALSE</tag> <tag>false</tag> <tag>0</tag> <tag /> http://cvs.php.net/viewcvs.cgi/pear/PEAR_PackageFileManager_Frontend/Frontend.php?r1=1.3&r2=1.4&diff_format=u Index: pear/PEAR_PackageFileManager_Frontend/Frontend.php diff -u pear/PEAR_PackageFileManager_Frontend/Frontend.php:1.3 pear/PEAR_PackageFileManager_Frontend/Frontend.php:1.4 --- pear/PEAR_PackageFileManager_Frontend/Frontend.php:1.3 Sat May 20 18:46:18 2006 +++ pear/PEAR_PackageFileManager_Frontend/Frontend.php Sun May 21 10:28:13 2006 @@ -15,7 +15,7 @@ * @author Laurent Laville <pear@laurent-laville.org> * @copyright 2005-2006 Laurent Laville * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Frontend.php,v 1.3 2006/05/20 18:46:18 farell Exp $ + * @version CVS: $Id: Frontend.php,v 1.4 2006/05/21 10:28:13 farell Exp $ * @since File available since Release 0.1.0 */ @@ -312,8 +312,15 @@ if (count($custom)) { // hack for PEAR::Config that cannot parse correctly boolean for XML container foreach ($this->_options as $kdef => $vdef) { - if (is_bool($this->_options[$kdef]) && empty($custom[$kdef])) { - $custom[$kdef] = false; + if (is_bool($this->_options[$kdef])) { + if (empty($custom[$kdef])) { + $custom[$kdef] = false; + } else { + $a = $custom[$kdef]; + $a = eregi_replace('^false$', '0', trim($a)); + $a = eregi_replace('^true$' , '1', trim($a)); + $custom[$kdef] = (bool) $a; + } } } // $this->_options = $this->array_merge_recursive($default, $custom);

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