<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 22 May 2013 00:23:10 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Zend_Config_Ini and a string]]></title>
      <guid>http://www.phpdeveloper.org/news/16499</guid>
      <link>http://www.phpdeveloper.org/news/16499</link>
      <description><![CDATA[<p>
In a new post today <i>Rob Allen</i> shows a method you can drop into your Zend Framework application to <a href="http://akrabat.com/zend-framework/zend_config_ini-and-a-string/">allow Zend_Config_Ini to take in a string</a> instead of being restricted to loading a file.
</p>
<blockquote>
With PHP 5.3 however there is is a new function called <a href="http://php.net/parse_ini_string">parse_ini_string()</a> which will allow us to load arbitrary ini string into Zend_Config objects. This can't go into Zend Framework 1 though due to our PHP 5.2.4 minimum version requirement. As I needed this for a project, I extended Zend_Config_Ini to support this feature, which means simply overloading a single method.
</blockquote>
<p>
He includes the code for the method - the App_Config_Ini class that includes a _parseIniFile method that checks to see if the last four characters of the input value are ".ini". If so, it loads like normal. If not, it assumes it's a configuration string and parses it with the new parse_ini_string method. 
</p>]]></description>
      <pubDate>Tue, 21 Jun 2011 12:30:50 -0500</pubDate>
    </item>
  </channel>
</rss>
