History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-388
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Darby Felton
Reporter: Darby Felton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Instantiation Simplification

Created: 19/Sep/06 05:09 PM   Updated: 05/Jul/07 02:43 PM
Component/s: Zend_Config
Affects Version/s: 0.1.5
Fix Version/s: 0.2.0

Time Tracking:
Not Specified

Tags:
Participants: Darby Felton and Rob Allen


 Description  « Hide
Reduce the complexity of instantiation from:
require_once 'Zend/Config.php';
require_once 'Zend/Config/Ini.php';
$config = new Zend_Config(Zend_Config_Ini::load('/path/to/config.ini', 'staging'));

to:

require_once 'Zend/Config/Ini.php';
$config = new Zend_Config_Ini('/path/to/config.ini', 'staging');


 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Rob Allen - 20/Sep/06 11:21 AM
Your proposed syntax would probably require deriving Zend_Config_Ini from Zend_Config to get all the common iteration, counting, __get etc code. During the original proposal process, it was decided that this was not desirable.

I would have thought that a syntax more like Zend_Db would be preferred for consistency?

i.e.

$config = Zend_Config::factory('ini', array('filename'=>'/path/to/config.ini', 
                 'section'=>'staging'));

would be more in line with Zend_Db's system.


Darby Felton - 20/Sep/06 11:38 AM
Indeed, I left the approach you mention above to be considered as a separate issue, since the two approaches need not be mutually exclusive.

The factory approach remains here for reference purposes; we may end up creating a JIRA issue for this, too.

I'll have some patches ready soon to help resolve this one; I want to coordinate with you on the development and nail down issues with respect to the next release.


Darby Felton - 28/Sep/06 12:05 PM
Fixed with SVN revision 1100