View Source

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

{zone-data:proposer-list}
[Ben Scholzen|mailto:mail@dasprids.de]
[Alexander Veremyev (Zend Liaison)|~alexander]
{zone-data}

{zone-data:revision}
1.0 - 10 May 2008: Initial proposal.
{zone-data}

{zone-data:overview}
Zend_Config_Db will allow reading and writing configs to databases supported by Zend_Db_Adapter. This may be useful for runtime stored values, like those which can be set by an administrator panel.
{zone-data}

{zone-data:references}
{zone-data}

{zone-data:requirements}
* This component *will* only connect to the database if values are read or written.
* This component *will* allow creating new values and groups at runtime.
* This component *will* only query for required values and only catch all values if required by toArray().
* This component *will not* support sections, as they are not a requirement for a dynamic config.
* This component *will not* support merge (yet?).
{zone-data}

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

{zone-data:operation}
A Zend_Config_Db object is created with an instance of Zend_Db_Aadapter_Abstract. You may also specify another table name and the column names which are used. After instanciation it can be used like any other Zend_Config object
{zone-data}

{zone-data:milestones}
* Milestone 1: [DONE] Proposal finished
* Milestone 2: Waiting for community feedback
* Milestone 3: Working prototype checked into http://zend.svn.dasprids.de
* Milestone 4: Unit tests exist, work, and are checked into http://zend.svn.dasprids.de
* Milestone 5: Proposal approval
* Milestone 6: Initial documentation exists.
{zone-data}

{zone-data:class-list}
* Zend_Config_Db
{zone-data}

{zone-data:use-cases}
||UC-01||
Creating a Zend_Config_Db instance

{code}
$myAdapter = new Zend_Db_Adapter...;
$config = new Zend_Config_Db($myAdapter);
{code}

||UC-02||
Reading a value

{code}
$myRuntimeValue = $config->contact_form->receiver_address;
{code}

||UC-03||
Writing a value to the database

{code}
$config->contact_form->receiver_address = 'some@address.com';
{code}
{zone-data}

{zone-data:skeletons}
Skeletons will follow later
{code}
{code}
{zone-data}

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