ZF2-4: Zend_Config_Ini should support string input


Add the ability to pass an INI string to Zend_Config_Ini and have it parse the string.

At present, it is not possible to parse an INI string via Zend_Config_Ini. The string must be written to a file first.


As soon as we get to PHP 5.3 as minimum, we can do this as parse_ini_string() will be available.

We can do so on trunk already?

Here is my hack:

I inherit from Zend_Config_Ini and copy and paste the method _parseIniFile($filename).

In this method i changed the parse_ini_file() function to parse_ini_string().

Perhaps there should be some better approach using an abstract class from which Zend_Config_Ini and Zend_Config_String should inherit.

Fixed in ZF2 with Zend\Config\Reader\Ini::fromString()