Issue Details (XML | Word | Printable)

Key: ZF-6111
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Benjamin Eberlei
Reporter: Goran Juric
Votes: 0
Watchers: 0
Operations

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

Add option to Zend_Config_Writer to skip section names

Created: 23/Mar/09 04:49 PM   Updated: 05/Nov/09 10:50 AM   Resolved: 05/Nov/09 10:50 AM
Component/s: Zend_Config_Writer
Affects Version/s: 1.7.7
Fix Version/s: 1.10.0

Time Tracking:
Not Specified


 Description  « Hide

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:

public function write($filename = null, Zend_Config $config = null, $exclusiveLock = null, $useSectionName = true)

and instead of just checking if section name is a string

if (is_string($sectionName)) {
            $data = array($sectionName => $data);
        }

we could check for the $useSectionNames as well:

if (($useSectionName) && (is_string($sectionName))) {
            $data = array($sectionName => $data);
        }

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



Goran Juric added a comment - 01/May/09 08:36 AM

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?

Regards!


Benjamin Eberlei added a comment - 05/Nov/09 10:05 AM

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


Benjamin Eberlei added a comment - 05/Nov/09 10:50 AM

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