我有兩個配置文件。一個是ini one is php。他們看起來像下面。我需要更新數據庫文件名但其餘的文件必須是不變。任何想法如何做?閱讀,編輯和保存配置文件(php)
的config.ini
; Turning Debugging on
[test]
developer = true
; Production site configuration data
[production]
database.params.dbname = /var/lib/firebird/data/radek_db.gdb
和setting.php
<?php
/**
The settings file
*/
#This will be done automatically if u want to override it uncomment the next line few lines
/*
$Path = 'mainline';
#Database to connect to:
$Database = "radek_db";
?>
多於字符串替換我需要找到該選項,然後替換它的值。不知道是否可以這樣做 – Radek 2010-07-07 04:03:10
啊 - 我假設你知道目前的選項改變是什麼。我正在適當地修改我的答案。 – 2010-07-07 17:39:36
謝謝@Mickey,最後一件事情就是隻在特定的部分進行搜索:-) – Radek 2010-07-08 00:03:35