<?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>Arron Woods</title>
	<atom:link href="http://www.arronwoods.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.arronwoods.com/blog</link>
	<description>Technology, website development, reviews and how-to&#039;s</description>
	<lastBuildDate>Wed, 10 Apr 2013 19:55:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Parsing CIF files to get train schedule data in PHP</title>
		<link>http://www.arronwoods.com/blog/2013/04/parsing-cif-files-to-get-train-schedule-data-in-php/</link>
		<comments>http://www.arronwoods.com/blog/2013/04/parsing-cif-files-to-get-train-schedule-data-in-php/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 19:55:25 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=900</guid>
		<description><![CDATA[I&#8217;ve had some fun looking at what data you can get via the National Rail Open Data scheme, and was really impressed by the ActiveMQ implementation they&#8217;ve got for Real Time Train Movement Messages! The messages National Rail send allow you to plot trains to stations, or even along route, but the message only contains [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve had some fun looking at what data you can get via the National Rail Open Data scheme, and was really impressed by the ActiveMQ implementation they&#8217;ve got for Real Time Train Movement Messages!</p>
<p>The messages National Rail send allow you to plot trains to stations, or even along route, but the message only contains station IDs or train IDs &#8211; which is kinda boring. I like to visualise the data, on a map for example.</p>
<p>To get the station name and location for a particular train message one has to access an entirely different database, from another provider. Along comes ATOC with their CIF files, which look very scary compared to ActiveMQ.</p>
<p>To cut a long story as short as I can, the CIF files contain a lot of information (400MB+ files), using string length and new lines to split up the data. You can<a href="http://data.atoc.org/"> sign up to download the files on the ATOC website</a>, and the <a href="http://www.atoc.org/clientfiles/File/RSPDocuments/20070801.pdf">specification for the files is available here</a>.</p>
<p>Why the blog post? Well, I needed a way to parse these files to populate a Mongo database and wanted to promote the <a href="https://github.com/rb-cohen/php-cif-parser">PHP CIF parser</a> I&#8217;ve started work on: <a href="https://github.com/rb-cohen/php-cif-parser">https://github.com/rb-cohen/php-cif-parser</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/04/parsing-cif-files-to-get-train-schedule-data-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Kent &#8211; The first meetup</title>
		<link>http://www.arronwoods.com/blog/2013/04/php-kent-the-first-meetup/</link>
		<comments>http://www.arronwoods.com/blog/2013/04/php-kent-the-first-meetup/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 16:50:03 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=888</guid>
		<description><![CDATA[Thursday 18th April 2013 at the LOL Bar in Maidstone. It&#8217;s been a long time coming (the idea started in 2010), but my business partner and I have finally got around to organising a local PHP user group in Kent (UK). I attend PHP London frequently, but am hoping to meet local developers and share [...]]]></description>
				<content:encoded><![CDATA[<h2>Thursday 18th April 2013 at the LOL Bar in Maidstone.</h2>
<p>It&#8217;s been a long time coming (the idea started in 2010), but my business partner and I have finally got around to organising a local PHP user group in Kent (UK).</p>
<p>I attend PHP London frequently, but am hoping to meet local developers and share ideas outside of that. Not able to get enough of PHP user groups, I plan to attend both on a monthly basis! <img src='http://www.arronwoods.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For more information on the meetup, like when the next event is scheduled, and to RSVP &#8211; please head over to the <a href="http://www.meetup.com/PHP-Kent/">meetup page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/04/php-kent-the-first-meetup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the raw POST or PUT data of a request in ZF2 MVC</title>
		<link>http://www.arronwoods.com/blog/2013/03/getting-the-raw-post-or-put-data-of-a-request-in-zf2-mvc/</link>
		<comments>http://www.arronwoods.com/blog/2013/03/getting-the-raw-post-or-put-data-of-a-request-in-zf2-mvc/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 22:36:32 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Web dev]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zf2]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=867</guid>
		<description><![CDATA[If you&#8217;re sending raw data to ZF2 over http (perhaps a json document), you can use the &#8220;getContent()&#8221; method of Zend\Http\PhpEnvironment\Request. How does this work in practice? In a controller you might want to do something like this: 1 2 3 4 5 6 7 8 9 &#60;?php namespace Application\Controller;&#60;/code&#62; &#160; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re sending raw data to ZF2 over http (perhaps a json document), you can use the &#8220;getContent()&#8221; method of Zend\Http\PhpEnvironment\Request.</p>
<h2>How does this work in practice?</h2>
<p>In a controller you might want to do something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">namespace</span> Application\Controller<span style="color: #339933;">;&lt;/</span>code<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Zend\Mvc\Controller\AbstractActionController<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> Zend\View\Model\ViewModel<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> IndexController <span style="color: #000000; font-weight: bold;">extends</span> AbstractActionController <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>But if you&#8217;re always expecting a certain format, say JSON, a controller plugin could give you back the array or object rather than a lot of json_decode calls in your controllers.</p>
<p>The plugin:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">namespace</span> My\Mvc\Controller\Plugin<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> Zend\Mvc\Controller\Plugin\Params <span style="color: #b1b100;">as</span> ZendParams<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Params <span style="color: #000000; font-weight: bold;">extends</span> ZendParams <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> fromJson<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getController</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$json</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">return</span> <span style="color: #000088;">$json</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And then its as simple as:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">params</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fromJson</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h2>Help! Sometimes getContent() doesn&#8217;t return my data.</h2>
<p>The method uses file_get_contents(&#8216;php://input&#8217;) to get the raw data from the HTTP request. Unfortuantely, the php://input stream <a title="PHP Manual: Wrappers PHP" href="http://www.php.net/manual/en/wrappers.php.php">can only be read once per process</a>. I did have a plug-in that called file_get_contents(&#8216;php://input&#8217;) too, and if $request-&gt;getContent() gets called after this, it will be empty!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/03/getting-the-raw-post-or-put-data-of-a-request-in-zf2-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RB Fitocracy wordpress plugin released</title>
		<link>http://www.arronwoods.com/blog/2013/02/rb-fitocracy-wordpress-plugin-released/</link>
		<comments>http://www.arronwoods.com/blog/2013/02/rb-fitocracy-wordpress-plugin-released/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 21:21:18 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=849</guid>
		<description><![CDATA[I&#8217;ve just released a new WordPress plug-in to display Fitocracy stats on your blog. Give it a whirl and let me know what you think: http://wordpress.org/extend/plugins/rb-fitocracy/ The next version will have more information available (total points, most recent workout, etc). As soon as its possible (via some sort of official Fitocracy API) I&#8217;ll be removing the [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just released a new WordPress plug-in to display Fitocracy stats on your blog. Give it a whirl and let me know what you think: <a href="http://wordpress.org/extend/plugins/rb-fitocracy/">http://wordpress.org/extend/plugins/rb-fitocracy/</a></p>
<p>The next version will have more information available (total points, most recent workout, etc). As soon as its possible (via some sort of official Fitocracy API) I&#8217;ll be removing the need to enter your own account details too!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/02/rb-fitocracy-wordpress-plugin-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Virgin Media broadband in MEx &#8211; will this post make it online?</title>
		<link>http://www.arronwoods.com/blog/2013/02/virgin-media-broadband-in-mex-will-this-post-make-it-online/</link>
		<comments>http://www.arronwoods.com/blog/2013/02/virgin-media-broadband-in-mex-will-this-post-make-it-online/#comments</comments>
		<pubDate>Sat, 02 Feb 2013 16:48:13 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Peeves]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=832</guid>
		<description><![CDATA[For the last few weeks my Virgin Media broadband service has been unusable during peak times. Unfortunately Virgin media don&#8217;t consider this a service fault, merely an inconvenience. When do VM expect me to use my broadband, when I&#8217;m not at home or in bed? The sad thing is, this is a massive problem for VM across [...]]]></description>
				<content:encoded><![CDATA[<p>For the last few weeks my Virgin Media broadband service has been unusable during peak times. Unfortunately <a title="Virgin Media Community forum post" href="http://community.virginmedia.com/t5/Up-to-30Mb-Setup-Equipment/High-packet-loss-ME7/m-p/1681592#M174347" target="_blank">Virgin media don&#8217;t consider this a service fault</a>, merely an inconvenience. When do VM expect me to use my broadband, when I&#8217;m not at home or in bed?</p>
<p>The sad thing is, this is a massive problem for VM across the country. A quick look through posts on their forum, <a title="Virgin Media Community peak search" href="http://community.virginmedia.com/t5/forums/searchpage/tab/message?q=peak" target="_blank">a large percentage of them</a> are about poor service at peak times.</p>
<p>I&#8217;ve been monitoring the situation for the last week, this is what I&#8217;ve found so far. 50% pack loss on most evenings and for the majority of Saturday (today).</p>
<div id="attachment_833" class="wp-caption aligncenter" style="width: 591px"><img class="size-full wp-image-833" alt="Virgin Media MEx Service status" src="http://www.arronwoods.com/blog/wp-content/uploads/2013/02/Virgin-Media-Week-1.png" width="581" height="336" /><p class="wp-caption-text">Virgin Media MEx Service status</p></div>
<p>If it continues, I&#8217;ll have to find an ADSL provider with a decent contention ratio.. does anyone know of one? <img src='http://www.arronwoods.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/02/virgin-media-broadband-in-mex-will-this-post-make-it-online/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wishing for a Fitocracy API</title>
		<link>http://www.arronwoods.com/blog/2013/01/wishing-for-a-fitocracy-api/</link>
		<comments>http://www.arronwoods.com/blog/2013/01/wishing-for-a-fitocracy-api/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 22:20:02 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Peeves]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.arronwoods.com/blog/?p=800</guid>
		<description><![CDATA[So its been a while since my last post. Rather than come up with some decent content I thought I&#8217;d waste time updating the theme of the blog and coming up with a new whizzy plugin. Progress, right? I was hoping to get my Fitocracy stats up on the blog as a widget, but turns [...]]]></description>
				<content:encoded><![CDATA[<p>So its been a while since my last post. Rather than come up with some decent content I thought I&#8217;d waste time updating the theme of the blog and coming up with a new whizzy plugin. Progress, right?</p>
<p>I was hoping to get my <a href="http://www.fitocracy.com" target="_blank">Fitocracy</a> stats up on the blog as a widget, but turns out its (next to) impossible at the moment. I get that an API isn&#8217;t always first on the agenda or something that users should expect to have &#8211; but it would be nice!</p>
<p>As soon as I can get a feed of my profile data I&#8217;ll be adding the widget and then releasing the plugin to the world. I&#8217;ve put in a request on the <a href="https://www.fitocracy.com/forum/topic/16535/" target="_blank">Fito forums</a>, lets see if anyone has any ideas.</p>
<p>There are some other unofficial Fitocracy APIs out there, but none seem to work at the moment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2013/01/wishing-for-a-fitocracy-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running phing from its phar</title>
		<link>http://www.arronwoods.com/blog/2012/04/running-phing-from-its-phar/</link>
		<comments>http://www.arronwoods.com/blog/2012/04/running-phing-from-its-phar/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 21:52:50 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=448</guid>
		<description><![CDATA[As of phing 2.4.10 you can download phing as a phar file, perfect for using phing on servers with PHP &#62; 5.3 but without access to PEAR. Quite new to phar files I struggled to get started, but it turns out its actually really easy! Failing to find any resources online myself, hopefully this will [...]]]></description>
				<content:encoded><![CDATA[<p>As of phing 2.4.10 you can download phing as a phar file, perfect for using phing on servers with PHP &gt; 5.3 but <strong>without</strong> access to PEAR. Quite new to phar files I struggled to get started, but it turns out its actually really easy! Failing to find any resources online myself, hopefully this will help somebody else.<br />
<span id="more-448"></span></p>
<h3>Setting up the variables</h3>
<p>Getting started is simple, we just have to tell phing to find itself in the phar file. On unix, you can run the following commands, or download <a href="#setupcode">the script</a> I&#8217;ve made to automate it all:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_COMMAND</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHING_HOME</span>=phar:<span style="color: #000000; font-weight: bold;">///</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>phing.phar
$ <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PHP_CLASSPATH</span>=<span style="color: #800000;">${PHING_HOME}</span><span style="color: #000000; font-weight: bold;">/</span>classes
$ <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">phing</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${PHP_COMMAND}</span> <span style="color: #007800;">${PHING_HOME}</span>&quot;</span></pre></td></tr></table></div>

<p>Now you can use phing as you would had you installed it from PEAR, like so:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span>phing <span style="color: #660033;">-h</span></pre></td></tr></table></div>

<h3>Automating this process</h3>
<p>Nobody wants to type that out everytime, so just use <a href="#setupcode">my setup.sh script</a>, stick it in the same directory as phing.phar and just run:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666;">$ </span>. .<span style="color: #000000; font-weight: bold;">/</span>setup.sh</pre></td></tr></table></div>

<p><em>Note the double dot, this is important (or it won&#8217;t export the variables to the current bash process).<br />
</em><br />
The file setup.sh consists of:<br />
<a name="setupcode"></a></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${BASH_SOURCE[0]}</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-h</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SOURCE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">do</span> <span style="color: #007800;">SOURCE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(readlink &quot;$SOURCE&quot;)</span>&quot;</span>; <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$( cd -P &quot;$( dirname &quot;$SOURCE&quot; )</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">pwd</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">&quot;
&nbsp;
export PHP_COMMAND=&quot;</span><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #ff0000;">&quot;
export PHING_HOME=&quot;</span>phar:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #800000;">${DIR}</span><span style="color: #000000; font-weight: bold;">/</span>phing.phar<span style="color: #ff0000;">&quot;
export PHP_CLASSPATH=&quot;</span><span style="color: #800000;">${PHING_HOME}</span><span style="color: #000000; font-weight: bold;">/</span>classes<span style="color: #ff0000;">&quot;
&nbsp;
alias phing=&quot;</span><span style="color: #800000;">${PHP_COMMAND}</span> <span style="color: #800000;">${PHING_HOME}</span><span style="color: #ff0000;">&quot;</span></pre></td></tr></table></div>

<p><a name="download"></a><br />
But just <a href='http://www.blograndom.com/blog/wp-content/uploads/2012/04/setup.txt'>download it</a> to wherever phing.phar is, rename it to setup.sh, chmod it and run it &#8211; it&#8217;s quicker (kinda)!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2012/04/running-phing-from-its-phar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RB Internal Links v2.0.14</title>
		<link>http://www.arronwoods.com/blog/2011/05/rb-internal-links-v2-0-14/</link>
		<comments>http://www.arronwoods.com/blog/2011/05/rb-internal-links-v2-0-14/#comments</comments>
		<pubDate>Sat, 07 May 2011 17:42:20 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[RB Internal Links]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=430</guid>
		<description><![CDATA[A mini maintenance release addressing a shortfall in the wordpress shortcode parser. Unfortunately the wordpress shortcode API can&#8217;t successfully process the following: Normal content OR Normal content To circumvent this, where users require no link text (to display the post title), the plugin will now accept the string &#8220;{{empty}}&#8221; as the link content like so: [...]]]></description>
				<content:encoded><![CDATA[<p>A mini maintenance release addressing a shortfall in the wordpress shortcode parser.</p>
<p>Unfortunately the <a href="http://codex.wordpress.org/Shortcode_API">wordpress shortcode API</a> can&#8217;t successfully process the following:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;1&quot;</span> <span style="color: #339933;">/</span><span style="color: #009900;">&#93;</span>
Normal content
<span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #009900;">&#93;</span>Link content<span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>intlink<span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>OR</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>intlink<span style="color: #009900;">&#93;</span>
Normal content
<span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #009900;">&#93;</span>Link content<span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>intlink<span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>To circumvent this, where users require no link text (to display the post title), the plugin will now accept the string &#8220;{{empty}}&#8221; as the link content like so:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;1&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #009900;">&#123;</span>empty<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>intlink<span style="color: #009900;">&#93;</span>
Normal content
<span style="color: #009900;">&#91;</span>intlink id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;2&quot;</span><span style="color: #009900;">&#93;</span>Link content<span style="color: #009900;">&#91;</span><span style="color: #339933;">/</span>intlink<span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p>I submitted a bug 2 years ago [<a href="http://core.trac.wordpress.org/ticket/9264">http://core.trac.wordpress.org/ticket/9264</a>], unfortunately it remains unfixed at the date of this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2011/05/rb-internal-links-v2-0-14/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery find next element in DOM by selector</title>
		<link>http://www.arronwoods.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/</link>
		<comments>http://www.arronwoods.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 18:57:45 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[Web dev]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=402</guid>
		<description><![CDATA[If you need to find the next occurrence of an element within the DOM, but aren&#8217;t sure where it is (i.e. you can&#8217;t just use $.next) I wrote a jQuery plugin that will traverse through the DOM from the current element til it hits either the &#8216;body&#8217; tag or a parent you specify. 1 2 [...]]]></description>
				<content:encoded><![CDATA[<p>If you need to find the next occurrence of an element within the DOM, but aren&#8217;t sure where it is (i.e. you can&#8217;t just use $.next) I wrote a jQuery plugin that will traverse through the DOM from the current element til it hits either the &#8216;body&#8217; tag or a parent you specify.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> $ <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    $.<span style="color: #660066;">fn</span>.<span style="color: #660066;">nextElementInDom</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>selector<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">var</span> defaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> stopAt <span style="color: #339933;">:</span> <span style="color: #3366CC;">'body'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
        options <span style="color: #339933;">=</span> $.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>defaults<span style="color: #339933;">,</span> options<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">var</span> parent <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">var</span> found <span style="color: #339933;">=</span> parent.<span style="color: #660066;">find</span><span style="color: #009900;">&#40;</span>selector<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">switch</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #009900;">&#40;</span>found.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> found<span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">case</span> <span style="color: #009900;">&#40;</span>parent.<span style="color: #660066;">length</span> <span style="color: #339933;">===</span> <span style="color: #CC0000;">0</span> <span style="color: #339933;">||</span> parent.<span style="color: #660066;">is</span><span style="color: #009900;">&#40;</span>options.<span style="color: #660066;">stopAt</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> $<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">default</span><span style="color: #339933;">:</span>
                <span style="color: #000066; font-weight: bold;">return</span> parent.<span style="color: #660066;">nextElementInDom</span><span style="color: #009900;">&#40;</span>selector<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span> jQuery <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Download it here: <a href='http://www.blograndom.com/blog/wp-content/uploads/2011/04/jquery.nextElementInDom.js'>jquery.nextElementInDom.js</a></p>
<p>And here is how you would use it:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">var</span> elementNeeded <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.firstElement'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">nextElementInDom</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.secondElement'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Where your HTML might look like this:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;firstElement&quot;</span>&gt;</span>Our first element<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
&nbsp;
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
        <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;secondElement&quot;</span>&gt;</span>Second element is in a different place<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;</span>
      <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2011/04/jquery-find-next-element-in-dom-by-selector/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>php-ssrs v0.1</title>
		<link>http://www.arronwoods.com/blog/2011/03/php-ssrs-v0-1/</link>
		<comments>http://www.arronwoods.com/blog/2011/03/php-ssrs-v0-1/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 00:04:42 +0000</pubDate>
		<dc:creator>Arron</dc:creator>
				<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://www.blograndom.com/blog/?p=396</guid>
		<description><![CDATA[A beta release of php-ssrs, a PHP SOAP client for Sql Reporting Services, that I helped write with Ideal Websites is now available for download. Grab a copy of it from the Google Code project page here: php-ssrs The QuickStart guide should be all you need to get going, there are also more detailed samples [...]]]></description>
				<content:encoded><![CDATA[<p>A beta release of php-ssrs, a PHP SOAP client for Sql Reporting Services, that I helped write with <a href="http://www.idealwebsites.co.uk">Ideal Websites</a> is now available for download.</p>
<p>Grab a copy of it from the Google Code project page here: <a href="http://code.google.com/p/php-ssrs/downloads/list">php-ssrs</a></p>
<p>The <a href="http://code.google.com/p/php-ssrs/wiki/QuickStart">QuickStart</a> guide should be all you need to get going, there are also more detailed samples available in the download. Getting a rendered report is made real easy, just take a look at the sample below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
    <span style="color: #0000ff;">'username'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'testing'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'password'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'password'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ssrs</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SSRS_Report<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://localhost/reportserver/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadReport</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/Reports/Reference_Report'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSessionId</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executionInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ExecutionID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setExecutionParameters</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SSRS_Object_ExecutionParameters<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">executionInfo</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Parameters</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ssrs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">render</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTML4.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PDF | XML | CSV</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.arronwoods.com/blog/2011/03/php-ssrs-v0-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
