<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[
(First) Get Zend_DB.::factory with a Zend_Config object working * * Zend_DB::factory only accepts an array as param.Zend Framework: Zend_DB Component Proposal
Proposed Component Name
Zend_DB
Developer Notes
http://framework.zend.com/wiki/display/ZFDEV/Zend_DB
Proposers
Daniel Schwiperich
Revision
1.1 - 1 August 2006: Updated from community comments. (wiki revision: 12)
Table of Contents
1. Overview
2. References
3. Component Requirements, Constraints, and Acceptance Criteria
4. Dependencies on Other Framework Components
5. Theory of Operation
To get compatible to Zend_Config it has also to accept an object of type Zend_Config
I've changed therefore the factorymethod a little bit, that it'll accept a Zend_Config object
and turns the object into an array. If the object contains other types than Strings an exception will be thrown.
See the example below...6. Milestones / Tasks
7. Class Index
8. Use Cases
| UC-01 |
|---|
An example config.xml
The DB-Init in index.php
9. Class Skeletons
The updated DB_Zend::factory method. Changes between the //----- comments
5 Comments
comments.show.hideAug 29, 2006
Gavin
<p>I suggest revising the proposal to pose this issue for all components. The idea of using an instance of Zend_Config should be considered not just for Zend_Db, but for all components that might accept configuration in the form of key-value pairs. I also suggest renaming the proposal, perhaps to "Integrating Zend_Config".</p>
Sep 23, 2006
Daniel Schwiperich
<p>Hi Gavin,<br />
yeah you're right. It was just the first case I recognized, that it would be nice to get these two components compatible.<br />
I would rename my proposal, but i'm not able to find the "edit button"!? Maybe im blind <ac:emoticon ac:name="smile" /> </p>
Apr 28, 2007
Anton Egorov
<p>It's useless. Try this as applied to your example:</p>
<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
$db = Zend_Db::factory($config->database->dbtype, $config->database->asArray());
]]></ac:plain-text-body></ac:macro>
Oct 29, 2007
Daniel Schwiperich
<p>Could a authorized user please remove this proposal. After a year of no further response it's is really useless in current versions.<br />
I'm not allowed to remove my own proposal. thx</p>
Oct 29, 2007
Darby Felton
<p>Re-parented proposal to "Removed Component Proposals"</p>