我有以下格式的配置XML文件:
<?xml version="1.0"?>
<configdata>
<development>
<siteTitle>You are doing Development</siteTitle>
</development>
<test extends="development">
<siteTitle>You are doing Testing</siteTitle>
</test>
<production extends="development">
<siteTitle>You are in Production</siteTitle>
</production>
</configdata>
要讀取這個配置文件應用環境設置,目前我使用的,在index.php文件下面的代碼:
$appEnvironment = "production";
$config = new Zend_Config_Xml('/config/settings.xml', $appEnvironment);
要在多個環境中部署此代碼,因爲用戶必須更改index.php文件。而不是這樣做,是否有可能在xml文件中保留一個屬性,「say active = true」。基於哪個Zend_Config_Xml會知道要讀取哪些xml文件設置部分?