2011-04-17 57 views
-1

https://github.com/pce/config_lite/blob/master/README.asciidocGET /梨模塊config_lite,問題設置INI文件鍵儲蓄更新ini文件

我使用 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" 

添加錯線剎車的文件,但我認爲主要的問題是 「」,它爲什麼添加它們?我如何防止添加它們?

+0

如果您正在使用最後兩個關於同一主題的問題中提到的'parse_ini_file',則行結尾和引號不會真的成爲問題。 – mario 2011-04-17 19:49:58

+0

但我該如何寫入和從parse_ini_file讀取?就像普通的數組一樣?你能指點我一個很好的數組教程嗎? – Joricam 2011-04-17 21:15:45

+0

你有一個與你最後一個問題:http://stackoverflow.com/questions/5695145/how-to-read-and-write-to-an-ini-file-with-php/5695202#5695202 - 對於教程請向Google詢問或瀏覽PHP手持設備。 Stackoverflow用於編碼問題,而不是免費的語言介紹。 – mario 2011-04-17 21:18:51

回答

0

請在pear.php.net上爲Config_Lite包打開功能請求。

+0

有人可以解釋爲什麼我downvoted? – cweiske 2011-04-18 06:41:00