<?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>Werx Limited &#187; php</title>
	<atom:link href="http://werxltd.com/wp/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://werxltd.com/wp</link>
	<description>We make IT work.</description>
	<lastBuildDate>Thu, 29 Jul 2010 19:00:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using PHP to write PHP</title>
		<link>http://werxltd.com/wp/2010/07/29/using-php-to-write-php/</link>
		<comments>http://werxltd.com/wp/2010/07/29/using-php-to-write-php/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 19:00:49 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[kml]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[utilities]]></category>
		<category><![CDATA[wkt]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=630</guid>
		<description><![CDATA[I ran into a situation recently where I had a very large array object that was not going to change. It was the polygon coordinates for the world countries to be used in KML provided by Thematic Mapping. I didn&#8217;t wan&#8217;t to pull this data out of MySQL every time I went to build a [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a situation recently where I had a very large array object that was not going to change. It was the polygon coordinates for the world countries to be used in <a href="http://code.google.com/apis/kml/documentation/">KML</a> provided by <a href="http://thematicmapping.org/">Thematic Mapping</a>.</p>
<p>I didn&#8217;t wan&#8217;t to pull this data out of MySQL every time I went to build a map, I wanted to use one giant static array instead. So to write the array back out in a re-usable fashion I developed the following code which can take any array, of any depth, associative or index based, and spit out corresponding PHP that you can copy and paste back into your script.</p>
<pre class="brush:php">function phpPrintArr(array $arr) {
	echo "array(".PHP_EOL;

	$c = 1;
	$total = count($arr);

	foreach($arr as $i =&gt;$v) {
		$iq = is_numeric($i) ? '' : '"';
		$vq = is_numeric($v) ? '' : '"';
		$e = $c &lt; $total ? ',' : '';

		if(is_array($v)) {
			echo $iq.$i.$iq.'=&gt;'.PHP_EOL;
			phpPrintArr($v);
			echo $e.PHP_EOL;
		} else {
			echo $iq.$i.$iq.'=&gt;'.$vq.$v.$vq.$e.PHP_EOL;
		}
		$c++;
	}

	echo ")".PHP_EOL;
}</pre>
<p>Oh, and for anyone who is interested in the array of country polygons this produced from the Thematic Mapping Engine data, <a href="http://werxltd.com/software/TME_Countries">here is the rather large array</a>. Feel free to use it in your own KML project.</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/07/29/using-php-to-write-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HipHop for PHP</title>
		<link>http://werxltd.com/wp/2010/04/29/hiphop-for-php/</link>
		<comments>http://werxltd.com/wp/2010/04/29/hiphop-for-php/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 12:00:15 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[it industry]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[high performance]]></category>
		<category><![CDATA[hiphop]]></category>
		<category><![CDATA[web scale]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=573</guid>
		<description><![CDATA[Earlier this year Facebook developers caused quite a stir in the PHP community by releasing HipHop, the central piece in their high-performance arsenal. Here is the video of the initial announcement along with some juicy technical details: If you are interested in seeing how your PHP project fares when run through HipHop, check out the [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this year <a href="http://developers.facebook.com/blog/post/358">Facebook developers</a> caused quite a stir in the PHP community by releasing <a href="http://en.wikipedia.org/wiki/HipHop_(software)">HipHop</a>, the central piece in their high-performance arsenal.</p>
<p><a href="http://www.ustream.tv/recorded/4409735">Here is the video</a> of the initial announcement along with some juicy technical details:<br />
<object id="utv946196" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="386" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="name" value="utv_n_687056" /><param name="flashvars" value="loc=%2F&amp;autoplay=false&amp;vid=4409735&amp;locale=en_US" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.ustream.tv/flash/video/4409735" /><embed id="utv946196" type="application/x-shockwave-flash" width="480" height="386" src="http://www.ustream.tv/flash/video/4409735" allowscriptaccess="always" allowfullscreen="true" flashvars="loc=%2F&amp;autoplay=false&amp;vid=4409735&amp;locale=en_US" name="utv_n_687056"></embed></object></p>
<p>If you are interested in seeing how your PHP project fares when run through HipHop, check out the official <a href="http://github.com/facebook/hiphop-php">HipHop project page</a>.</p>
<p>With tools like HipHop, scripting languages like PHP are no longer subject to the charges of gross computational inefficiency. In short, it&#8217;s a great day to be a web developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2010/04/29/hiphop-for-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SOAPjr Demo</title>
		<link>http://werxltd.com/wp/2009/10/17/soapjr-demo/</link>
		<comments>http://werxltd.com/wp/2009/10/17/soapjr-demo/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 13:36:33 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[soapjr]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=230</guid>
		<description><![CDATA[A demo of SOAPjr using PHP/Symfony and ExtJS is now available at http://dev.communitybookshelf.org/ This demo showcases these custom components: Backend: pSOAPjr sfSOAPjrActionPlugin Frontend eSOAPjr Questions/comments? We&#8217;d love to hear from you!]]></description>
			<content:encoded><![CDATA[<p>A demo of <a href="http://soapjr.org/">SOAPjr</a> using <a href="http://php.net/">PHP</a>/<a href="http://www.symfony-project.org/">Symfony</a> and <a href="http://www.extjs.com/">ExtJS</a> is now available at <a href="http://dev.communitybookshelf.org/">http://dev.communitybookshelf.org/</a></p>
<p>This demo showcases these custom components:</p>
<ul>
<li>Backend:
<ul>
<li><a href="http://werxltd.com/wp/portfolio/psoapjr/">pSOAPjr</a></li>
<li><a href="http://werxltd.com/wp/portfolio/sfsoapjractionplugin/">sfSOAPjrActionPlugin</a></li>
</ul>
</li>
<li>Frontend
<ul>
<li><a href="http://werxltd.com/wp/portfolio/esoapjr/">eSOAPjr</a></li>
</ul>
</li>
</ul>
<p><a href="http://werxltd.com/wp/contact-us/">Questions/comments? We&#8217;d love to hear from you!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/10/17/soapjr-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running PHP in Java</title>
		<link>http://werxltd.com/wp/2009/10/06/running-php-in-java/</link>
		<comments>http://werxltd.com/wp/2009/10/06/running-php-in-java/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:25:54 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[high availability]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php in the cloud]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=227</guid>
		<description><![CDATA[Many might consider even the thought of running PHP inside of a Java Virtual Machine to be anathema. Others will wonder why bother (apart from the novelty). However running PHP in Java has one crucal benefit: it future-proofs your code. Quercus is a nifty utility that will allow you to run PHP code in clouds such [...]]]></description>
			<content:encoded><![CDATA[<p>Many might consider even the thought of running <a href="http://www.php.net/">PHP</a> inside of a <a href="http://en.wikipedia.org/wiki/Java_Virtual_Machine">Java Virtual Machine</a> to be anathema. Others will wonder why bother (apart from the novelty). However running PHP in Java has one crucal benefit: it future-proofs your code.</p>
<p><a href="http://caucho.com/resin/doc/quercus.xtp">Quercus</a> is a nifty utility that will allow you to run PHP code in clouds such as <a href="http://blog.caucho.com/?p=187">Google App Engine</a><sup>1</sup>. This means your <a href="http://drupal.org/">Drupal</a> and <a href="http://wordpress.org/">WordPress</a> sites can now be distributed across a highly avaliable and scalable cloud infrustructure.</p>
<p>Now if we can only get an <a href="http://en.wikipedia.org/wiki/Model–view–controller">MVC</a> framework like <a href="http://kohanaphp.com/">Kohana</a> or <a href="http://www.symfony-project.org/">Symfony</a> to work on top of this system..</p>
<ol class="footnotes"><li id="footnote_0_227" class="footnote">Other great articles on running PHP in Google&#8217;s App Engine can be found <a href="http://www.phpclasses.org/blog/post/92-Running-PHP-on-Google-App-Engine.html">here</a> and <a href="http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/">here</a>. <a href="http://www.ibm.com/developerworks/web/library/wa-quercus/index.html?ca=dgr-twtrQuercusdth-WD&amp;S_TACT=105AGY46&amp;S_CMP=TWDW">IBM has also highlighted</a> this utility.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/10/06/running-php-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magical PHP JSON Object Cleaner</title>
		<link>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/</link>
		<comments>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 14:27:03 +0000</pubDate>
		<dc:creator>wes</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[recursive]]></category>

		<guid isPermaLink="false">http://werxltd.com/wp/?p=159</guid>
		<description><![CDATA[I wrote this method the other day that takes a simple PHP object, inspects it&#8217;s properties and &#8220;prunes&#8221; empty ones. I wrote this method in order to compress JSON objects by removing null properties before sending them down the wire, a big problem when using base objects or models. If you find this useful or [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote this method the other day that takes a simple PHP object, inspects it&#8217;s properties and &#8220;prunes&#8221; empty ones. I wrote this method in order to compress JSON objects by removing null properties before sending them down the wire, a big problem when using base objects or models.</p>
<p>If you find this useful or a have a suggestion, feel free to let me know!</p>
<pre class="brush:php">
private function getStripped($obj) {
		$objVars = get_object_vars($obj);

		if(count($objVars) > 0) {
			foreach($objVars as $propName => $propVal) {
				if(gettype($propVal) == "object") {
					$cObj = $this->getStripped($propVal);
					if($cObj == null) {
						unset($obj->$propName);
					} else {
						$obj->$propName = $cObj;
					}
				} else {
					if(empty($propVal)) {
						unset($obj->$propName);
					}
				}
			}
		} else {
			return null;
		}
		return $obj;
	}</pre>
]]></content:encoded>
			<wfw:commentRss>http://werxltd.com/wp/2009/07/29/magical-php-json-object-cleaner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
