Hello all
For a number of reasons, I prefer to store configuration options in
XML files and not INI files.
In "application.ini", it is possible to specify constants in the values:
[production]
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
The structure of the above in XML would be:
<production>
<bootstrap>
<path></path>
<class></class>
</bootstrap>
<resources>
<frontController>
<controllerDirectory></controllerDirectory>
</frontController>
</resources>
</production>
How can I use constants in the XML?
For example, I would like to specify:
<production>
<bootstrap>
<path>APPLICATION_PATH . /Bootstrap.php</path>
</bootstrap>
</production>
But this does not work. The value production->bootstrap->path is
treated as a string:
"Warning: require_once(APPLICATION_PATH . /application/Bootstrap.php) [...]"
Similarly, I would like to set the error_reporting level:
<production>
<phpSettings>
<error_reporting>E_ALL|E_STRICT</error_reporting>
</phpSettings>
</production>
But again, the constants are treated as strings and consequently are not set.
Is it at all possible to work around these issues but still use XML to
store application settings?
I am using Zend Framework 1.8.2 (same behavior in 1.8.1).
Thank you in advance.
Jonathan Maron