使用 PEAR 模块 config_lite 获取/设置 ini 文件键,保存更新的 ini 文件时出现问题
https://github.com/pce/config_lite/blob/master/README.asciidoc
我正在使用 Config_Lite,这是一个非常适合设置和配置的 PEAR 模块获取ini文件键值。问题是,当我保存它时,它不会保留文件结构。
例如(原始ini文件):
[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
修改保存的ini文件:
[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"
向文件添加错误的行刹车,但我认为主要问题是“”,为什么要添加它们?我怎样才能阻止它添加它们?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请在 pear.php.net 上针对 Config_Lite 包提出功能请求。
Please open a feature request on pear.php.net for the Config_Lite package.