ZF-388: Instantiation Simplification

Issue Type: Improvement Created: 2006-09-19T17:09:37.000+0000 Last Updated: 2007-07-05T14:43:21.000+0000 Status: Resolved Fix version(s): - 0.2.0 (29/Oct/06)

Reporter: Darby Felton (darby) Assignee: Darby Felton (darby) Tags: - Zend_Config

Related issues: Attachments:


Reduce the complexity of instantiation from:

<pre class="highlight">
require_once 'Zend/Config.php';
require_once 'Zend/Config/Ini.php';
$config = new Zend_Config(Zend_Config_Ini::load('/path/to/config.ini', 'staging'));


<pre class="highlight">
require_once 'Zend/Config/Ini.php';
$config = new Zend_Config_Ini('/path/to/config.ini', 'staging');


Posted by Rob Allen (rob) on 2006-09-20T11:21:20.000+0000

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?


<pre class="highlight">
$config = Zend_Config::factory('ini', array('filename'=>'/path/to/config.ini', 

would be more in line with Zend_Db's system.

Posted by Darby Felton (darby) on 2006-09-20T11:38:22.000+0000

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. :)

Posted by Darby Felton (darby) on 2006-09-28T12:05:24.000+0000

Fixed with SVN revision 1100

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.