ZF-6111: Add option to Zend_Config_Writer to skip section names

Issue Type: Improvement Created: 2009-03-23T16:49:54.000+0000 Last Updated: 2009-11-05T10:50:15.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Goran Juric (gog) Assignee: Benjamin Eberlei (beberlei) Tags: - Zend_Config_Writer

Related issues: Attachments:


It would be nice if Zend_Config_Writer would skip section names if instructed to do so.

I am using Zend_Config_Ini for my testing, development and staging environments but I create a single Zend_Config (array) for use in my production environment.

The change is really simple, write() should have an extra parameter:

<pre class="highlight"> 
public function write($filename = null, Zend_Config $config = null, $exclusiveLock = null, $useSectionName = true)

and instead of just checking if section name is a string

<pre class="highlight"> 
        if (is_string($sectionName)) {
            $data = array($sectionName => $data);

we could check for the $useSectionNames as well:

<pre class="highlight"> 
        if (($useSectionName) && (is_string($sectionName))) {
            $data = array($sectionName => $data);

If it will help I can provide patch files for these changes.


Posted by Goran Juric (gog) on 2009-05-01T08:36:50.000+0000

Hi, can I expect this issue to be resolved. What can I need do to make this happen?

Is it necessary to explain the use case, submit patches, create tests?


Posted by Benjamin Eberlei (beberlei) on 2009-11-05T10:05:49.000+0000

I will add a new ini writer for exactly this issue.

Posted by Benjamin Eberlei (beberlei) on 2009-11-05T10:50:15.000+0000

Added and documented a new config writer "SimpleIni" which writes all data into the global INI namespace.

Have you found an issue?

See the Overview section for more details.


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

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