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}

{zone-data:component-name}
Zend_Config Refactoring
{zone-data}

{zone-data:proposer-list}
[Lars Strojny|mailto:lars@strojny.net]
{zone-data}

{zone-data:revision}
0.1 - 26 December 2007: Initial version
{zone-data}

{zone-data:overview}
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
{zone-data}

{zone-data:references}
* [Automatic primitive type detection for Zend_Config|http://framework.zend.com/issues/browse/ZF-2312]
{zone-data}

{zone-data:requirements}
* 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
{zone-data}

{zone-data:dependencies}
* Zend_Config
{zone-data}

{zone-data:operation}
{zone-data}

{zone-data:milestones}
* Milestone 1: Finish proposal
* Milestone 2: Implement prototype in laboratory
{zone-data}

{zone-data:class-list}
* Zend_Config
* Zend_Config_Adapter_Interface
* Zend_Config_Adapter_Xml
* Zend_Config_Adapter_Ini
* Zend_Config_Adapter_Yaml (?)
* Zend_Config_Adapter_Db (?)
{zone-data}

{zone-data:use-cases}
||UC-01||
{code}
$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'));
{code}
{zone-data}

{zone-data:skeletons}
None yet
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>