<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Peter Krantz &#187; PHP</title>
	<atom:link href="http://www.peterkrantz.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterkrantz.com</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 09:57:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Synchronizing RDF data from files with the ARC triple store</title>
		<link>http://www.peterkrantz.com/2008/arc-filesync-plugin1/</link>
		<comments>http://www.peterkrantz.com/2008/arc-filesync-plugin1/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 17:35:38 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[RDF]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/arc-filesync-plugin1/</guid>
		<description><![CDATA[I have been playing with the excellent ARC framework for a small legal information project (more on ...]]></description>
			<content:encoded><![CDATA[<p>I have been playing with the excellent <a href="http://arc.semsol.org/">ARC framework</a> for a small legal information project (more on that soon). I am beginning to think that many RDF usage scenarios involve data in files (stored in a file system) combined with a triple store that preferrably should be kept in sync with the files. Inspired by Niklas Lindström&#8217;s Oort I wrote a small plugin to do that in ARC.</p>
<p>The plugin extends the ARC2_Store class with a sync_with_folder($path_to_folder) method. Here is the <a href="http://www.peterkrantz.com/wp-content/uploads/2008/02/arc2_filesystemsynchronizerpluginphp.txt">source code for the initial version</a> if you want to play with it. Rename the file to ARC2_FilesystemSynchronizerPlugin.php ansd save in the ARC plugin folder.</p>
<p>By popular request, here is a simple usage example:</p>
<p> //Include ARC and configuration<br />
include_once(&#8216;path/to/arc/ARC2.php&#8217;);<br />
include_once(&#8216;path/to/arc/config.php&#8217;);</p>
<p>$store = ARC2::getComponent(&#8216;FileSystemSynchronizerPlugin&#8217;, $config);<br />
$store-&gt;sync_with_folder(&#8220;/root/path/to/file/store&#8221;);</p>
<p>Save the above code to a file called sync.php and run from the command line with <kbd>php sync.php</kbd></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/arc-filesync-plugin1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Intricacies of PHP compared to Ruby</title>
		<link>http://www.peterkrantz.com/2008/php-for-beginners/</link>
		<comments>http://www.peterkrantz.com/2008/php-for-beginners/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 09:25:19 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/php-for-beginners/</guid>
		<description><![CDATA[Via Tim Bray&#8217;s blog I found zestyping&#8217;s &#8220;Why PHP should never be taught&#8221;. In it he provides ...]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://www.tbray.org/ongoing/When/200x/2007/12/31/Year-Sweep-Tech">Tim Bray&#8217;s blog</a> I found <a href="http://zestyping.livejournal.com/124503.html?thread=690519">zestyping&#8217;s &#8220;Why PHP should never be taught&#8221;</a>. In it he provides some interesting PHP code that will be difficult for beginners to understand.<span id="more-127"></span></p>
<pre class="brush: php; title: ; notranslate">$a = 0;
$b = &quot;eggs&quot;;
$c = &quot;spam&quot;;</pre>
<p>yields:</p>
<pre class="brush: ruby; title: ; notranslate">
a == b
b != c
a == c
a == d
b != d
c != d
</pre>
<p>(Please note that d hasn&#8217;t been defined). In the comments, people freak out and tell him that this behaviour is defined in the documentation. I guess that makes it even worse.</p>
<p>Trying the same thing in Ruby:</p>
<pre class="brush: ruby; title: ; notranslate">
a = 0
b = &quot;eggs&quot;
c = &quot;spam&quot;

a == b
=&gt; false

b == c
=&gt; false

a == c
=&gt; false

a == d
NameError: undefined local variable or method 'd' for main:Object from (irb):7
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/php-for-beginners/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.peterkrantz.com @ 2012-02-04 11:05:22 -->
