<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple config management for PHP</title>
	<atom:link href="http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/</link>
	<description>PHP, AS3, Flex, Flash</description>
	<lastBuildDate>Tue, 29 Jun 2010 14:08:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Me</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-1454</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Tue, 23 Feb 2010 14:49:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-1454</guid>
		<description>$value = $configManager-&gt;getConfig[&#039;datasource.host&#039;];

Shouldn&#039;t that be ( ) brackets?</description>
		<content:encoded><![CDATA[<p>$value = $configManager-&gt;getConfig['datasource.host'];</p>
<p>Shouldn&#8217;t that be ( ) brackets?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandrar</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-1024</link>
		<dc:creator>sandrar</dc:creator>
		<pubDate>Thu, 10 Sep 2009 13:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-1024</guid>
		<description>Hi! I was surfing and found your blog post... nice! I love your blog.  :) Cheers! Sandra. R.</description>
		<content:encoded><![CDATA[<p>Hi! I was surfing and found your blog post&#8230; nice! I love your blog.  <img src='http://blog.eirikhoem.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Cheers! Sandra. R.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simple config management for PHP - Eirik Hoem [ Planet PHP ]</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-224</link>
		<dc:creator>Simple config management for PHP - Eirik Hoem [ Planet PHP ]</dc:creator>
		<pubDate>Tue, 10 Jun 2008 18:01:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-224</guid>
		<description>[...] 30th 2008 9:32am  [-] From: blog.eirikhoem.net  [...]</description>
		<content:encoded><![CDATA[<p>[...] 30th 2008 9:32am  [-] From: blog.eirikhoem.net  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Back, (somewhat) rested, and much catching up to do. &#171; Trausch’s Little Home</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-220</link>
		<dc:creator>Back, (somewhat) rested, and much catching up to do. &#171; Trausch’s Little Home</dc:creator>
		<pubDate>Thu, 05 Jun 2008 06:51:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-220</guid>
		<description>[...] I&#8217;m really going to want to read from the things that will benefit me little. Today I read an article which I could have lived my life without reading, if only because that&#8217;s already how I do [...]</description>
		<content:encoded><![CDATA[<p>[...] I&#8217;m really going to want to read from the things that will benefit me little. Today I read an article which I could have lived my life without reading, if only because that&#8217;s already how I do [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Saray</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-217</link>
		<dc:creator>Aaron Saray</dc:creator>
		<pubDate>Mon, 02 Jun 2008 16:27:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-217</guid>
		<description>This configuration option is nice... but what about times when your configuration has to make a decision?  For example, if I&#039;m using the same code base over multiple partner websites, but the name is different, I need to make a choice on what name to display as the global one.  

INI files would allow you to have either 1) multiple INI files - kinda code duplication or 2) have them outside of the code base - which may make them naked to versioning software.

I&#039;ve found that I end up using a class with a static &#039;get&#039; method - that creates a new instance of itself in singleton pattern - which performs all of the logic calculations.

Keep up writing!
-aaron</description>
		<content:encoded><![CDATA[<p>This configuration option is nice&#8230; but what about times when your configuration has to make a decision?  For example, if I&#8217;m using the same code base over multiple partner websites, but the name is different, I need to make a choice on what name to display as the global one.  </p>
<p>INI files would allow you to have either 1) multiple INI files &#8211; kinda code duplication or 2) have them outside of the code base &#8211; which may make them naked to versioning software.</p>
<p>I&#8217;ve found that I end up using a class with a static &#8216;get&#8217; method &#8211; that creates a new instance of itself in singleton pattern &#8211; which performs all of the logic calculations.</p>
<p>Keep up writing!<br />
-aaron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Carlson &#187; links for 2008-05-31</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-214</link>
		<dc:creator>Chris Carlson &#187; links for 2008-05-31</dc:creator>
		<pubDate>Sat, 31 May 2008 23:32:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-214</guid>
		<description>[...] Simple config management for PHP (tags: php webdesign programming language configuration application classes)       06:32:47 pm on May 31, 2008 &#124; # &#124; [...]</description>
		<content:encoded><![CDATA[<p>[...] Simple config management for PHP (tags: php webdesign programming language configuration application classes)       06:32:47 pm on May 31, 2008 | # | [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Sharman</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-213</link>
		<dc:creator>Michael Sharman</dc:creator>
		<pubDate>Fri, 30 May 2008 23:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-213</guid>
		<description>As a php noob...

Why have the expense of instantiating an object each time for these static variable lookups, why not just include a config file?

require_once &quot;myConfig.inc.php&quot;;

Then just access the vars as normal? If overwriting is a concern you can always prefix with something like:

$config_adminemail = &quot;me@wherever.com&quot;;</description>
		<content:encoded><![CDATA[<p>As a php noob&#8230;</p>
<p>Why have the expense of instantiating an object each time for these static variable lookups, why not just include a config file?</p>
<p>require_once &#8220;myConfig.inc.php&#8221;;</p>
<p>Then just access the vars as normal? If overwriting is a concern you can always prefix with something like:</p>
<p>$config_adminemail = &#8220;me@wherever.com&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lux</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-211</link>
		<dc:creator>Lux</dc:creator>
		<pubDate>Fri, 30 May 2008 20:33:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-211</guid>
		<description>Looks like my examples didn&#039;t make it through...  Let&#039;s try again:

; &lt;?php /*

...

; */ ?&gt;</description>
		<content:encoded><![CDATA[<p>Looks like my examples didn&#8217;t make it through&#8230;  Let&#8217;s try again:</p>
<p>; &lt;?php /*</p>
<p>&#8230;</p>
<p>; */ ?&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lux</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-210</link>
		<dc:creator>Lux</dc:creator>
		<pubDate>Fri, 30 May 2008 20:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-210</guid>
		<description>We use ini files extensively for configuration info in our framework, but one thing to be mindful of if you&#039;re storing sensitive info in there is to make sure it can&#039;t be seen in the browser.  You could do something in your config like this:


   Deny from all


But we take an extra step I&#039;d recommend taking as well:

1) Make sure the files end in .php
2) Add the following lines at the top and bottom:

; 

(Hopefully that renders okay :)  Now if someone requests that in the browser, the site returns a blank screen with just &quot;; &quot; on it.  Hope that helps you out too.</description>
		<content:encoded><![CDATA[<p>We use ini files extensively for configuration info in our framework, but one thing to be mindful of if you&#8217;re storing sensitive info in there is to make sure it can&#8217;t be seen in the browser.  You could do something in your config like this:</p>
<p>   Deny from all</p>
<p>But we take an extra step I&#8217;d recommend taking as well:</p>
<p>1) Make sure the files end in .php<br />
2) Add the following lines at the top and bottom:</p>
<p>; </p>
<p>(Hopefully that renders okay <img src='http://blog.eirikhoem.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Now if someone requests that in the browser, the site returns a blank screen with just &#8220;; &#8221; on it.  Hope that helps you out too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Vines</title>
		<link>http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/comment-page-1/#comment-209</link>
		<dc:creator>Matthew Vines</dc:creator>
		<pubDate>Fri, 30 May 2008 19:45:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.eirikhoem.net/index.php/2008/05/30/simple-config-management-for-php/#comment-209</guid>
		<description>In response to Jeremy,

That is a great point, and something you should always try to be cognizant of as you set up your we projects.  I find that one of the easiest ways to protect config files, whether, ini file format, or xml format, is to give them a .php extension.  This way the server parses them as PHP (which ends up looking like a blank file to the browser).  But your code doesn&#039;t care what the extension is, as we are just working with a stream to a file, the extension is irrelevant.  Only one way to go, but its a viable option for those who are not strong server administrators.</description>
		<content:encoded><![CDATA[<p>In response to Jeremy,</p>
<p>That is a great point, and something you should always try to be cognizant of as you set up your we projects.  I find that one of the easiest ways to protect config files, whether, ini file format, or xml format, is to give them a .php extension.  This way the server parses them as PHP (which ends up looking like a blank file to the browser).  But your code doesn&#8217;t care what the extension is, as we are just working with a stream to a file, the extension is irrelevant.  Only one way to go, but its a viable option for those who are not strong server administrators.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
