View Source

<ac:macro ac:name="note"><ac:parameter ac:name="title">Under Construction</ac:parameter><ac:rich-text-body>
<p>This proposal is under construction and is not ready for review.</p></ac:rich-text-body></ac:macro>

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

Zend_Config Refactoring

[Lars Strojny|]

0.1 - 26 December 2007: Initial version

Zend_Config suffers from various problems. The current implementation does not distinguish between the storage of the configuration (the configuration source) and the representation in the object. Every config class is representation and adapter at the same time.
As the organisation in adapters cuts down the native possibilities the config formats already provide. XML already has xinclude, which is more mature than the Zend_Config extension mechanism.
Additionally the value representation of the configuration is "just strings". This could be done much better.
The actual targets of this proposal:
* Better differentiation between source adapters and front representation to unify provided output
* The built-in options of a format should tap the full potential
* Keep the simple usage which is currently possible by providing more features

* [Automatic primitive type detection for Zend_Config|]

* Zend_Config adapters *must no longer* extend Zend_Config
* Zend_Config adapters *must* only read the configuration source
* Zend_Config adapters *must* normalize the different input sources
* Zend_Config_Adapter_Xml *must* capable of XIncludes
* Zend_Config_Adapter_Ini *must not* use parse_ini_file() any longer
* Zend_Config *should* represent configuration in the
* Zend_Config *should* manage an abitrary number of configuration sources at the same time by merging it

* Zend_Config


* Milestone 1: Finish proposal
* Milestone 2: Implement prototype in laboratory

* Zend_Config
* Zend_Config_Adapter_Interface
* Zend_Config_Adapter_Xml
* Zend_Config_Adapter_Ini
* Zend_Config_Adapter_Yaml (?)
* Zend_Config_Adapter_Db (?)

$config = new Zend_Config();
$config->addAdapter(new Zend_Config_Adapter_Ini('config/parameters.xml', 'live'));
$config->addAdapter(new Zend_Config_Adapter_Xml('config/routes.xml', 'live'));

None yet