-1

https://github.com/pce/config_lite/blob/master/README.asciidoc

I'm using Config_Lite, a PEAR module that's great to set and get ini file key values. The problem is that when I save it it does not keep the file structure.

For instance (original ini file):

[scripts]

[admin]
hide_fields[] = ctr_ad_headerImg

[widget_areas]
0.name = "Top Navigation"
0.id = top-nav
0.description = "Widget area at the very top of the page"

[default_colors]
sitebg = #EEEEEE
footerbg = #F8F8F8
link = #5F8200
url = #000000
bg = #F8F8F8
text = #000000
border = #F8F8F8

lu_link = #112BEA
lu_url = #112BEA
lu_bg = #EFEAE4
lu_text = #112BEA
lu_border = #F8F8F8

Modified saved ini file:

[scripts]

[admin]
hide_fields[0] = "ctr_ad_headerImg"

[widget_areas]
0.name = "Top Navigation"
0.id = "top-nav"
0.description = "Widget area at the very top of the page"

[default_colors]
sitebg = "f500f5"
footerbg = "F8F8F8"
link = "F8F8F8"
url = "F8F8F8"
bg = "F8F8F8"
text = "F8F8F8"
border = "F8F8F8"
lu_link = "F8F8F8"
lu_url = "F8F8F8"
lu_bg = "F8F8F8"
lu_text = "F8F8F8"
lu_border = "F8F8F8"

Adds wrong line brakes to the file, but I think the main problem is the "", why does it adds them? how can I prevent it from adding them?

cweiske
  • 30,033
  • 14
  • 133
  • 194
Joricam
  • 2,329
  • 4
  • 18
  • 14
  • The line endings and the quotes wouldn't really be a problem if you were using `parse_ini_file` as mentioned in your last two question about the same topic. – mario Apr 17 '11 at 19:49
  • but how do I write and read from the parse_ini_file? just as a regular array? Can you point me a good array tutorial? – Joricam Apr 17 '11 at 21:15
  • You got one with your last question: http://stackoverflow.com/questions/5695145/how-to-read-and-write-to-an-ini-file-with-php/5695202#5695202 - For tutorials please ask Google or peek into the PHP manaul. Stackoverflow is for coding questions, not for free language introductions. – mario Apr 17 '11 at 21:18
  • You can vote me down all day but I guess you need to vote me up again since you are wrong. And I really whish you are right. I did all this with parse_ini_file and it has the same quotes problem.!!! – Joricam Apr 17 '11 at 21:56
  • 1
    The downvote was for being pertinently lazy and reposting. And no, it strips the quotes. It's the very same function that's used for parsing the php.ini. So unless PHP does not run, your observation is highly unlikely to be true. Nobody is interested in guessing your actual code, btw. – mario Apr 17 '11 at 22:02

1 Answers1

0

Please open a feature request on pear.php.net for the Config_Lite package.

cweiske
  • 30,033
  • 14
  • 133
  • 194