INIファイルには、サンプルの設定を見て、私はZend Frameworkの中にストア構成に使用する方法である:
設定を読み込み
http://www.framework.zend.com/manual/en/zend.config.adapters.ini.html
; Production site configuration data
[production]
webhost = www.example.com
database.adapter = pdo_mysql
database.params.host = db.example.com
database.params.username = dbuser
database.params.password = secret
database.params.dbname = dbname
; Staging site configuration data inherits from production and
; overrides values as necessary
[staging : production]
database.params.host = dev.example.com
database.params.username = devuser
database.params.password = devsecret
:
:コンフィギュレーションを書く
$config = new Zend_Config_Ini('/path/to/config.ini', 'staging');
echo $config->database->params->host; // prints "dev.example.com"
echo $config->database->params->dbname; // prints "dbname"
// Load all sections from an existing config file, while skipping the extends.
$config = new Zend_Config_Ini('config.ini',
null,
array('skipExtends' => true,
'allowModifications' => true));
// Modify a value
$config->production->hostname = 'foobar';
// Write the config file
$writer = new Zend_Config_Writer_Ini(array('config' => $config,
'filename' => 'config.ini'));
$writer->write();
構成の各ノードはアレイに変換することができますが、複雑な配列を使用して構成クラスのインスタンスを作成し、ファイルに保存することもできます。
このタイプの設定は、人間が読める形式で編集可能です。
多分、同様の解決策を作成するようにしてください。