<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Don&#8217;t use YAML for PHP, use parse_ini_file</title>
	<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file</link>
	<description>Musings about technology from a Geek</description>
	<pubDate>Tue, 07 Sep 2010 01:45:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Even</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-4717</link>
		<dc:creator>Even</dc:creator>
		<pubDate>Sun, 27 Sep 2009 12:47:33 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-4717</guid>
		<description>Yes, JSON is a fair choice as stated Darkhogg. The best part about JSON is that YAML is an extension of JSON so everything written in JSON is a correct file for a YAML parser. It might be a very good point for a lot of people. But I personally love some parts of the languages extension brought by the YAML. The good way would be to have YAML support by default in PHP...</description>
		<content:encoded><![CDATA[<p>Yes, JSON is a fair choice as stated Darkhogg. The best part about JSON is that YAML is an extension of JSON so everything written in JSON is a correct file for a YAML parser. It might be a very good point for a lot of people. But I personally love some parts of the languages extension brought by the YAML. The good way would be to have YAML support by default in PHP&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darkhogg</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-4419</link>
		<dc:creator>Darkhogg</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:26:01 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-4419</guid>
		<description>Another option for tree-structured data is JSON. PHP comes with json libraries by default, and is a pretty simple syntax you can write directly and can be shared through every language.
Since json_decode() is a built-in function, it shouldn't be slow.

other option is using some sort of tree.structuring INI, such as Parent.child, and then in PHPH parse out the dots to make an array like $thing['Parent']['child'] ... that can be slow too, but maybe quickier than YAML</description>
		<content:encoded><![CDATA[<p>Another option for tree-structured data is JSON. PHP comes with json libraries by default, and is a pretty simple syntax you can write directly and can be shared through every language.<br />
Since json_decode() is a built-in function, it shouldn&#8217;t be slow.</p>
<p>other option is using some sort of tree.structuring INI, such as Parent.child, and then in PHPH parse out the dots to make an array like $thing[&#8217;Parent&#8217;][&#8217;child&#8217;] &#8230; that can be slow too, but maybe quickier than YAML</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: counterpoint</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-2794</link>
		<dc:creator>counterpoint</dc:creator>
		<pubDate>Wed, 08 Apr 2009 10:58:41 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-2794</guid>
		<description>For a long time the use of .ini files in PHP seemed to me a non-starter on the grounds that a syntax error in the .ini file would cause script processing to terminate.  Not the parse_ini_file function, but the entire PHP script.  It's in the nature of things that people will sometimes mess up configuration files.  So how would you cope with this - parse the ini file using string processing before submitting it to parse_ini_file?!  

More recently the function has returned an empty array or latterly false if there is a syntax error.  But even that means that no diagnostic can be given if the .ini file is in error.  This seems unacceptable in any system that aims to be user friendly, even when the user messes up.

YAML, XML, RelaxNG have the advantage of being a consistent and mutually supportive set of standards that support powerful configuration storage options.</description>
		<content:encoded><![CDATA[<p>For a long time the use of .ini files in PHP seemed to me a non-starter on the grounds that a syntax error in the .ini file would cause script processing to terminate.  Not the parse_ini_file function, but the entire PHP script.  It&#8217;s in the nature of things that people will sometimes mess up configuration files.  So how would you cope with this - parse the ini file using string processing before submitting it to parse_ini_file?!  </p>
<p>More recently the function has returned an empty array or latterly false if there is a syntax error.  But even that means that no diagnostic can be given if the .ini file is in error.  This seems unacceptable in any system that aims to be user friendly, even when the user messes up.</p>
<p>YAML, XML, RelaxNG have the advantage of being a consistent and mutually supportive set of standards that support powerful configuration storage options.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric J</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-2063</link>
		<dc:creator>Eric J</dc:creator>
		<pubDate>Mon, 26 Jan 2009 01:50:46 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-2063</guid>
		<description>Shouldn't this read, "Don't use YAML for configuration files in PHP"? I've found YAML and SPYC to be very handy for non-configuration purposes.</description>
		<content:encoded><![CDATA[<p>Shouldn&#8217;t this read, "Don&#8217;t use YAML for configuration files in PHP"? I&#8217;ve found YAML and SPYC to be very handy for non-configuration purposes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ananda</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1833</link>
		<dc:creator>ananda</dc:creator>
		<pubDate>Tue, 09 Dec 2008 02:52:36 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1833</guid>
		<description>What about MVC ?

what when the data comes from a database instead of a file ????</description>
		<content:encoded><![CDATA[<p>What about MVC ?</p>
<p>what when the data comes from a database instead of a file ????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob Desbois</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1795</link>
		<dc:creator>Rob Desbois</dc:creator>
		<pubDate>Mon, 01 Dec 2008 17:06:47 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1795</guid>
		<description>As stated by 'she' the ini file format doesn't support anything more complicated than (name =&#62; value) pairs.

My application requires some data which is in a structured tree format - impossible to represent in an ini file. With YAML it's easy.
Granted there are other formats which can support it - XML being the obvious one that springs to my mind, but I dislike the overheads of the structure and the unfriendliness to someone not well-versed in it. YAML is easy to read and easy to write whether you are man or machine, and whether you are a developer or not.</description>
		<content:encoded><![CDATA[<p>As stated by &#8217;she&#8217; the ini file format doesn&#8217;t support anything more complicated than (name =&gt; value) pairs.</p>
<p>My application requires some data which is in a structured tree format - impossible to represent in an ini file. With YAML it&#8217;s easy.<br />
Granted there are other formats which can support it - XML being the obvious one that springs to my mind, but I dislike the overheads of the structure and the unfriendliness to someone not well-versed in it. YAML is easy to read and easy to write whether you are man or machine, and whether you are a developer or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NOTini</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1448</link>
		<dc:creator>NOTini</dc:creator>
		<pubDate>Thu, 25 Sep 2008 02:48:07 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-1448</guid>
		<description>sometime I wanna define a dsl style config file.  the ini file looks like an ugly guy.

it's depends on the requirement. in my project, there are tons of config files with dsl style 

so I have no choice.</description>
		<content:encoded><![CDATA[<p>sometime I wanna define a dsl style config file.  the ini file looks like an ugly guy.</p>
<p>it&#8217;s depends on the requirement. in my project, there are tons of config files with dsl style </p>
<p>so I have no choice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick J</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-853</link>
		<dc:creator>Nick J</dc:creator>
		<pubDate>Thu, 22 May 2008 07:12:43 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-853</guid>
		<description>One problem with parse_ini_file is backwards compatibility, because until at least March 2007 you could not escape quotes in INI files.

E.g. if you wanted to use an INI file to do this: $array['x'] = 'The message said "Hello World!"...';
... then until just over a year ago, you could not do that due to a bug - i.e. an INI file like this:
------------
x =  "The message said \"Hello World!\"..."
------------
... would not work with parse_ini_file. Not being able to have quotes in strings is a pretty fundamental limitation, so for apps that have to support PHP5.x, that rules out using parse_ini_file.</description>
		<content:encoded><![CDATA[<p>One problem with parse_ini_file is backwards compatibility, because until at least March 2007 you could not escape quotes in INI files.</p>
<p>E.g. if you wanted to use an INI file to do this: $array[&#8217;x'] = &#8216;The message said "Hello World!"&#8230;&#8217;;<br />
&#8230; then until just over a year ago, you could not do that due to a bug - i.e. an INI file like this:<br />
&#8212;&#8212;&#8212;&#8212;<br />
x =  "The message said \"Hello World!\"&#8230;"<br />
&#8212;&#8212;&#8212;&#8212;<br />
&#8230; would not work with parse_ini_file. Not being able to have quotes in strings is a pretty fundamental limitation, so for apps that have to support PHP5.x, that rules out using parse_ini_file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: she</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-404</link>
		<dc:creator>she</dc:creator>
		<pubDate>Thu, 14 Feb 2008 20:45:21 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-404</guid>
		<description>Is your comment correct?

Yaml can store hashes and arrays, I dont think .ini can do.</description>
		<content:encoded><![CDATA[<p>Is your comment correct?</p>
<p>Yaml can store hashes and arrays, I dont think .ini can do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clint</title>
		<link>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-14</link>
		<dc:creator>Clint</dc:creator>
		<pubDate>Tue, 23 Oct 2007 14:56:51 +0000</pubDate>
		<guid>http://www.techyouruniverse.com/software/dont-use-yaml-for-php-use-parse_ini_file#comment-14</guid>
		<description>yaml is basically impossible to parse in bash. Its not easy in perl (but of course, doable). ini files, however, are dead simple to parse in bash and perl. :) When you have a heterogeneous environment, having one spot for local config information is a huge advantage.</description>
		<content:encoded><![CDATA[<p>yaml is basically impossible to parse in bash. Its not easy in perl (but of course, doable). ini files, however, are dead simple to parse in bash and perl. <img src='http://www.techyouruniverse.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> When you have a heterogeneous environment, having one spot for local config information is a huge advantage.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
