<?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>Sun, 19 May 2013 18:40:44 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brian Moon's Blog: Using ini files for PHP application settings]]></title>
      <guid>http://www.phpdeveloper.org/news/13875</guid>
      <link>http://www.phpdeveloper.org/news/13875</link>
      <description><![CDATA[<p>
In <a href="http://brian.moonspot.net/using-ini-files-for-php-application-settings">a new post</a> to his blog <i>Brian Moon</i> looks at a handy piece of functionality that comes with the default PHP installations (and is used by several major frameworks <a href="http://framework.zend.com">like this one</a>) - using INI files to store settings for an application.
</p>
<blockquote>
One of the challenges of this [three tier server setup] is where and how to store the connection information for all these services. We have done several things in the past. The most common thing is to store this information in a PHP file. [...] We have taken [it] one step further using some PHP ini trickeration. We use ini files that are loaded at PHP's startup and therefore the information is kept in PHP's memory at all times.
</blockquote>
<p>
They use the <a href="http://php.net/get_cfg_var">get_cfg_var</a> function and the "--with-config-file-scan-dir" option to tell PHP to automatically load in the ini files it finds in the named directory. He gives an example of both a simple configuration and a more complex situation where a MySQL instance can read from the ini file containing the username/password/host information.
</p>]]></description>
      <pubDate>Wed, 20 Jan 2010 10:40:39 -0600</pubDate>
    </item>
  </channel>
</rss>
