FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18352&edit=1

ID: 18352
Updated by: zenobic@gmail.com
Reported By: mfonda at php dot net
Summary: Arrays in global scope not supported
-Status: Open
+Status: Feedback
Type: Bug
Package: Config_Lite
Operating System: Linux
Package Version: SVN
PHP Version: 5.3.5
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
This is the current behaviour of Config_Lite,
it handles arrays "section-oriented".

Files created with Config_Lite, should behave as expected,
but if you create it from scratch (like in your example),
the underlying PHP function `parse_ini_file` provides no informations
about the scope of the data, an array could be a section or global
values in array syntax.

Writing a parser with metainformation could solve this issue,
but this would also mean to rely on a slower userland `parse ini`
method.

Do you think we should use a (userland) parse ini method and
keep the faster method optional?


Previous Comments:
------------------------------------------------------------------------

[2011-03-09 23:49:32] mfonda

Description:
------------
When attempting to use arrays in the global level, the output is
not correct.

Test script:
---------------
require_once 'Config/Lite.php';
file_put_contents('foo.ini', "arr[0]=val1\narr[1]=val2");
$cfg = new Config_Lite('foo.ini');
$cfg->save();
echo file_get_contents('foo.ini');

Expected result:
----------------
arr[0]=val1
arr[1]=val2

Actual result:
--------------
[arr]
0 = "val1"
1 = "val2"

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 16, '11 at 11:55p
activeMar 16, '11 at 11:55p
posts1
users1
websitepear.php.net

1 user in discussion

Zenobic: 1 post

People

Translate

site design / logo © 2022 Grokbase