使用 PEAR 模块 config_lite 获取/设置 ini 文件键,保存更新的 ini 文件时出现问题

发布于 2024-11-01 22:21:22 字数 1245 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏末的微笑 2024-11-08 22:21:22

请在 pear.php.net 上针对 Config_Lite 包提出功能请求。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文