cvs: pear /Config Config.php package.xml /Config/Config/Container IniFile.php
| From: | Christian Stocker | Date: | Sun, 16 Sep 2001 16:41:13 +0000 |
| Subject: | cvs: pear /Config Config.php package.xml /Config/Config/Container IniFile.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-853@lists.php.net to get a copy of this message | ||
chregu Sun Sep 16 12:41:13 2001 EDT
Modified files:
/pear/Config Config.php package.xml
/pear/Config/Config/Container IniFile.php
Log:
- Bug fixed, when $feature in ParseInput was not set
- some e_warnings fixed
thanks to Markus Fischer for the reports
Index: pear/Config/Config.php
diff -u pear/Config/Config.php:1.1 pear/Config/Config.php:1.2
--- pear/Config/Config.php:1.1 Tue Jul 31 06:51:03 2001
+++ pear/Config/Config.php Sun Sep 16 12:41:11 2001
@@ -16,7 +16,7 @@
// | Christian Stocker <chregu@phant.ch> |
// +----------------------------------------------------------------------+
//
-// $Id: Config.php,v 1.1 2001/07/31 10:51:03 chregu Exp $
+// $Id: Config.php,v 1.2 2001/09/16 16:41:11 chregu Exp $
require_once( "PEAR.php") ;
@@ -36,7 +36,7 @@
*
* @author Alexander Merz <alexander.merz@t-online.de>
* @access public
-* @version $Id: Config.php,v 1.1 2001/07/31 10:51:03 chregu Exp $
+* @version $Id: Config.php,v 1.2 2001/09/16 16:41:11 chregu Exp $
* @package Config
*/
@@ -238,13 +238,18 @@
* @return mixed returns a PEAR_ERROR, if error occurs
*/
- function parseInput ($files ,$feature = array() )
+ function parseInput ($files ,$feature = Null )
{
if (is_array($files)) {
$totaldata = array();
foreach ($files as $datasrc)
{
- if (Pear::isError($error = $this->container->parseInput($datasrc,$feature)))
+ if (is_null($feature))
+ $error = $this->container->parseInput($datasrc);
+ else
+ $error = $this->container->parseInput($datasrc,$feature);
+
+ if (Pear::isError($error))
return $error;
$totaldata =
$this->array_merge_clobber($totaldata,$this->container->data);
@@ -255,7 +260,12 @@
}
else
{
- if (Pear::isError($error = $this->container->parseInput($files,$feature)))
+ if (is_null($feature))
+ $error = $this->container->parseInput($files);
+ else
+ $error = $this->container->parseInput($files,$feature);
+
+ if (Pear::isError($error))
return $error;
$this->data = $this->container->data;
Index: pear/Config/package.xml
diff -u pear/Config/package.xml:1.2 pear/Config/package.xml:1.3
--- pear/Config/package.xml:1.2 Tue Aug 28 19:24:49 2001
+++ pear/Config/package.xml Sun Sep 16 12:41:11 2001
@@ -10,10 +10,14 @@
<email></email>
</maintainer>
<release>
- <version>0.2</version>
- <date>2001-06-23</date>
+ <version>0.2.1</version>
+ <date>2001-09-26</date>
<notes>
Documentation is in README.Config.
+ 0.2.1 :
+ - Bug fixed, when $feature in ParseInput was not set
+ - some e_warnings fixed
+ (thanks to Markus Fischer for the reports)
</notes>
</release>
<filelist>
Index: pear/Config/Config/Container/IniFile.php
diff -u pear/Config/Config/Container/IniFile.php:1.1 pear/Config/Config/Container/IniFile.php:1.2
--- pear/Config/Config/Container/IniFile.php:1.1 Tue Jul 31 06:51:03 2001
+++ pear/Config/Config/Container/IniFile.php Sun Sep 16 12:41:12 2001
@@ -15,7 +15,7 @@
// | Authors: Alexander Merz <alexander.merz@t-online.de> |
// +----------------------------------------------------------------------+
//
-// $Id: IniFile.php,v 1.1 2001/07/31 10:51:03 chregu Exp $
+// $Id: IniFile.php,v 1.2 2001/09/16 16:41:12 chregu Exp $
require_once( "Config/Container.php" ) ;
@@ -26,7 +26,7 @@
*
* @author Alexander Merz <alexander.merz@t-online.de>
* @access public
-* @version $Id: IniFile.php,v 1.1 2001/07/31 10:51:03 chregu Exp $
+* @version $Id: IniFile.php,v 1.2 2001/09/16 16:41:12 chregu Exp $
* @package Config
*/
@@ -91,7 +91,7 @@
$char = substr( $line, 0, 1) ;
// a comment?
- if( $char == $this -> feature["cc"] )
+ if( isset($this->feature["cc"]) && $char == $this ->
feature["cc"] )
{
$found = 0 ;
}
@@ -130,7 +130,6 @@
$found = 2 ;
}
}
-
// creating the array
switch( $found )
{
@@ -138,10 +137,7 @@
$block = '/'.$block_found ;
break ;
case 2 :
-
- $aadd = $this -> data[ $block ] ;
- $aadd[ $key_found ] = (string)trim ((string)$value_found ) ;
- $this -> data[$block] = $aadd ;
+ $this->data[$block][$key_found] = (string)trim
((string)$value_found);
break ;
case 0 :
default :