<?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>Jonathan Cremin &#187; www</title>
	<atom:link href="http://crem.in/category/www/feed/" rel="self" type="application/rss+xml" />
	<link>http://crem.in</link>
	<description>Not&#160;designed&#160;for&#160;Internet&#160;Explorer</description>
	<lastBuildDate>Mon, 10 May 2010 11:34:09 +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>PHP caching and APC</title>
		<link>http://crem.in/2009/10/09/php-caching-and-apc/</link>
		<comments>http://crem.in/2009/10/09/php-caching-and-apc/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 20:34:21 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://crem.in/?p=305</guid>
		<description><![CDATA[A friend asked me recently about the caching options available to him with PHP on a linux stack. While he had looked into memcached and seen the difference it can make, he had overlooked APC. APC, or Alternative PHP Cache, not only allows for faster pages through opcode caching, but also since v3.0.0, allows for [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>A friend asked me recently about the caching options available to him with PHP on a linux stack. While he had looked into memcached and seen the difference it can make, he had overlooked APC.</p>
<p>APC, or Alternative PHP Cache, not only allows for faster pages through opcode caching, but also since v3.0.0, allows for users to store any kind of data in memory for access between and across all requests. See my example below for a better idea on how to use it.</p>
<pre><code>/* The first argument is the unique key which
 you will use to store some data later.
For globally cached data, the URL could make a good key,
and you could append the user id for user specific data.
The second argument is set to true or false depending
on whether APC finds data at the location,
if we don't find it, we know we need
to (re)generate it. */

$html = apc_fetch("unique_key_url", $success);
if(!$success)
{
	$html = big_and_slow_function();

	/*here the first argument is the key again,
	followed by the data to store and
	finally the time to live period in seconds */

	apc_add("unique_key_url", $html, 180);
}
echo $html;
</code></pre>
<p>Using a mechanism like this, you can see massive decreases in page load times. The friend I mentioned earlier brought his front page load time down from a number of seconds to low milliseconds.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2009/10/09/php-caching-and-apc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and stdClass</title>
		<link>http://crem.in/2009/06/28/php-and-stdclass/</link>
		<comments>http://crem.in/2009/06/28/php-and-stdclass/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 23:44:09 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://crem.in/?p=279</guid>
		<description><![CDATA[The built in class stdClass can be instantiated manually for creating generic objects which you can then set member variables for, this is useful for passing objects to other functions or methods which expect to take an object as an argument. An even more likely usage is casting an array to an object which takes [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The built in class stdClass can be instantiated manually for creating generic objects which you can then set member variables for, this is useful for passing objects to other functions or methods which expect to take an object as an argument. An even more likely usage is casting an array to an object which takes each value in the array and adds it as a member variable with the name based on the key in the array.</p>
<p><code>&lt;?php<br />
$obj = (object) array("foo" => "bar")<br />
echo $obj->foo; // outputs "bar"<br />
?&gt;<br />
</code></p>
<p>One place you might get caught out here is trying to directly access numerically indexed values on the object, this breaks PHP&#8217;s naming convention and does not work correctly even with escaping.</p>
<p><code>&lt;?php<br />
$obj = (object) array("foo"=>"bar","foobar");<br />
echo $obj->foo; //outputs "bar"<br />
echo $obj->{0}; //$x->0 would cause a syntax error, this simply causes a notice for being unable to find the variable.<br />
</code></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2009/06/28/php-and-stdclass/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTTP Auth with PHP</title>
		<link>http://crem.in/2009/06/27/http-auth-with-php/</link>
		<comments>http://crem.in/2009/06/27/http-auth-with-php/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 17:37:23 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://crem.in/?p=150</guid>
		<description><![CDATA[HTTP Auth has a number of practical uses even in complex PHP backed systems. A prime example, and the reason I had looked into it, is web service and API authentication. In this case it is much simpler for the client to provide the details in this manner rather than perform an extra request to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>HTTP Auth has a number of practical uses even in complex PHP backed systems. A prime example, and the reason I had looked into it, is web service and API authentication. In this case it is much simpler for the client to provide the details in this manner rather than perform an extra request to grab an authorisation token. A basic example lifted from the PHP manual is below.</p>
<pre><code>&lt;?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
&nbsp;&nbsp;&nbsp;&nbsp;header('WWW-Authenticate: Basic realm="My Realm"');
&nbsp;&nbsp;&nbsp;&nbsp;header('HTTP/1.0 401 Unauthorized');
&nbsp;&nbsp;&nbsp;&nbsp;echo 'Text to send if user hits Cancel button';
&nbsp;&nbsp;&nbsp;&nbsp;exit;
} else {
&nbsp;&nbsp;&nbsp;&nbsp;echo "&lt;p&gt;Hello {$_SERVER['PHP_AUTH_USER']}.&lt;/p&gt;";
&nbsp;&nbsp;&nbsp;&nbsp;echo "&lt;p&gt;You entered {$_SERVER['PHP_AUTH_PW']} as your password.&lt;/p&gt;";
}
?&gt;</code></pre>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2009/06/27/http-auth-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIB and Three Webtext PHP5 APIs</title>
		<link>http://crem.in/2009/06/15/aib-and-three-webtext-php5-apis/</link>
		<comments>http://crem.in/2009/06/15/aib-and-three-webtext-php5-apis/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 00:37:38 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[aib]]></category>
		<category><![CDATA[three]]></category>
		<category><![CDATA[webtext]]></category>

		<guid isPermaLink="false">http://jonathancremin.com/?p=241</guid>
		<description><![CDATA[Over the last day I&#8217;ve put together two PHP5 API classes (loosely termed, it&#8217;s screen scraping at heart) for online services I use, AIB online banking and Three&#8217;s newly launched webtexts. I&#8217;m releasing both under the LGPL license and you can find them in my open source releases directory. Update: I&#8217;ve ported the Three API [...]


Related posts:<ol><li><a href='http://crem.in/2009/06/17/three-web-text-widget/' rel='bookmark' title='Permanent Link: Three Web Text Widget'>Three Web Text Widget</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the last day I&#8217;ve put together two PHP5 API classes (loosely termed, it&#8217;s screen scraping at heart) for online services I use, AIB online banking and Three&#8217;s newly launched webtexts. I&#8217;m releasing both under the LGPL license and you can find them in my <a href="http://crem.in/releases">open source releases</a> directory.</p>
<p><em>Update: I&#8217;ve ported the Three API to Perl and added it to the three releases directory</em></p>


<p>Related posts:<ol><li><a href='http://crem.in/2009/06/17/three-web-text-widget/' rel='bookmark' title='Permanent Link: Three Web Text Widget'>Three Web Text Widget</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2009/06/15/aib-and-three-webtext-php5-apis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Tips #1: foreach</title>
		<link>http://crem.in/2009/02/06/php-tips-1-foreach/</link>
		<comments>http://crem.in/2009/02/06/php-tips-1-foreach/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 17:41:38 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[www]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php tips]]></category>

		<guid isPermaLink="false">http://jonathancremin.com/?p=215</guid>
		<description><![CDATA[I love foreach loops for their simplicity and readability, but they&#8217;re a bit quirky when it comes to PHP. Here&#8217;s a couple of tips I&#8217;ve picked up. The following are functionally the same: &#60;?php $arr = array("one", "two", "three"); reset($arr); while (list($key, $value) = each($arr)) { &#160;&#160;&#160;&#160;echo "Key: $key; Value: $value\n"; } foreach ($arr as [...]


Related posts:<ol><li><a href='http://crem.in/2009/06/28/php-and-stdclass/' rel='bookmark' title='Permanent Link: PHP and stdClass'>PHP and stdClass</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I love foreach loops for their simplicity and readability, but they&#8217;re a bit quirky when it comes to PHP. Here&#8217;s a couple of tips I&#8217;ve picked up.</p>
<h3>The following are functionally the same:</h3>
<p><code>&lt;?php<br />
$arr = array("one", "two", "three");<br />
reset($arr);<br />
while (list($key, $value) = each($arr)) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "Key: $key; Value: $value<br />\n";<br />
}<br />
foreach ($arr as $key => $value) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "Key: $key; Value: $value<br />\n";<br />
}<br />
?&gt;<br />
</code></p>
<h3>Ever want to drive straight into a foreach without checking that the array has elements?</h3>
<p><code>&lt;?php<br />
$non_array = null;<br />
foreach ((array) $non_array as $key => $value) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo "Key: $key; Value: $value<br />\n";<br />
}<br />
?&gt;<br />
</code></p>


<p>Related posts:<ol><li><a href='http://crem.in/2009/06/28/php-and-stdclass/' rel='bookmark' title='Permanent Link: PHP and stdClass'>PHP and stdClass</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2009/02/06/php-tips-1-foreach/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reasons I use Kohana over Codeigniter</title>
		<link>http://crem.in/2008/12/01/5-reasons-i-use-kohana-over-codeigniter/</link>
		<comments>http://crem.in/2008/12/01/5-reasons-i-use-kohana-over-codeigniter/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 10:08:53 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://jonathancremin.com/?p=172</guid>
		<description><![CDATA[I orginally discovered Codeigniter about 18 months ago and I was delighted to find a PHP framework that behaved largely intuitively to me. As I got used to its quirks and adapted it to better suit me, I happened across a forked project called Kohana. Having built a number of applications with Kohana, I have [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I orginally discovered <a href="http://codeigniter.com">Codeigniter</a> about 18 months ago and I was delighted to find a PHP framework that behaved largely intuitively to me. As I got used to its quirks and adapted it to better suit me, I happened across a forked project called Kohana. Having built a number of applications with <a href="http://kohanaphp.com">Kohana</a>, I have yet to feel the need to modify its default behaviour in any significant way. It just fits well with me.</p>
<p>These features are my favourite benefits of using Kohana over Codeigniter:</p>
<ol>
<li>Seperation of system files and static content by default. No extra work is needed to seperate your application files from the framework system files</li>
<li>Static classes for helpers instead of functions, allowing logical grouping of utility functions.</li>
<li>Does not break $_GET variables. I don&#8217;t care what the CI proponents say, breaking $_GET is unacceptable.</li>
<li>The session driver can optionally use native sessions. An application on it&#8217;s own secure enviroment doesn&#8217;t need to worry about native session security like you do on shared servers.</li>
<li>Supports only PHP5+; PHP4 is dead, and PHP6 is not too far off, it&#8217;s time to cast off the dead weight.</li>
</ol>
<p>There&#8217;s plenty more things I like better in Kohana, but the 5 above will have to do for now.</p>
<p>Codeigniter does have one advantage, better documentation, but as Kohana matures so should its documentation.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2008/12/01/5-reasons-i-use-kohana-over-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>localhostr uploadr</title>
		<link>http://crem.in/2008/09/29/localhostr-uploadr/</link>
		<comments>http://crem.in/2008/09/29/localhostr-uploadr/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 21:54:28 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[localhostr]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[mike]]></category>
		<category><![CDATA[simon360]]></category>
		<category><![CDATA[uploadr]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://crem.in/?p=141</guid>
		<description><![CDATA[Back in June simon360 released his dashboard widget for uploading files to localhostr. Earlier this month Mike released a windows desktop app which does much the same. Both of them use mail&#8217;s awesome design. They have teamed up and launched a single site that you can get them both from, localhostruploadr. Related posts:localhostr update


Related posts:<ol><li><a href='http://crem.in/2008/01/19/localhostr-update/' rel='bookmark' title='Permanent Link: localhostr update'>localhostr update</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Back in June <a href="http://simon360.com">simon360</a> released his dashboard widget for uploading files to localhostr. Earlier this month <a href="http://mjpa.co.uk">Mike</a> released a windows desktop app which does much the same. Both of them use <a href="http://mail.minthoster.com/">mail&#8217;s</a> awesome design. They have teamed up and launched a single site that you can get them both from, <a href="http://localhostruploadr.com">localhostruploadr</a>.</p>


<p>Related posts:<ol><li><a href='http://crem.in/2008/01/19/localhostr-update/' rel='bookmark' title='Permanent Link: localhostr update'>localhostr update</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2008/09/29/localhostr-uploadr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pushup ? browser update notifier</title>
		<link>http://crem.in/2008/08/13/pushup-browser-update-notifier/</link>
		<comments>http://crem.in/2008/08/13/pushup-browser-update-notifier/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 20:58:47 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[pushup]]></category>
		<category><![CDATA[update notifier]]></category>
		<category><![CDATA[web browser]]></category>

		<guid isPermaLink="false">http://crem.in/?p=60</guid>
		<description><![CDATA[Every developer out there is sick to death of the mostrosity that is IE6. As part of a movement to &#8220;push&#8221; users up from out-dated browsers, pushup is a little script to automatically notify those users and provide them with a link to update their browser. If you&#8217;ve visited this site on an older browser [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p><img class="no-border" title="Pushup browser nofitication" src="http://jonathancremin.com/wp-content/uploads/2008/08/picture-1.png" alt="" width="235" height="54" /><br />
Every developer out there is sick to death of the mostrosity that is IE6. As part of a movement to &#8220;push&#8221; users up from out-dated browsers, <a title="pushuptheweb" href="http://pushuptheweb.com" target="_blank">pushup</a> is a little script to automatically notify those users and provide them with a link to update their browser.</p>
<p>If you&#8217;ve visited this site on an older browser (extremely few do), you would aready have received a notification for this ;)</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2008/08/13/pushup-browser-update-notifier/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fugue Icon Pack &#8211; 2,800 Free Icons</title>
		<link>http://crem.in/2008/08/07/fugue-icon-pack-953-free-icons/</link>
		<comments>http://crem.in/2008/08/07/fugue-icon-pack-953-free-icons/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:56:26 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[www]]></category>
		<category><![CDATA[famfamfam]]></category>
		<category><![CDATA[fugue]]></category>
		<category><![CDATA[icon packs]]></category>

		<guid isPermaLink="false">http://crem.in/?p=52</guid>
		<description><![CDATA[Yusuke Kamiyamane has released another free icon pack called Fugue to follow up his other great Diagona pack. Both these packs make a great alternative to using the beaten-to-death famfamfam silk icon pack. Update: This guy is a machine, he&#8217;s now at 2,800 icons in this amazing pack No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Yusuke Kamiyamane has released another free icon pack called <a href="http://p.yusukekamiyamane.com/">Fugue</a> to follow up his other great Diagona pack. Both these packs make a great alternative to using the beaten-to-death <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam silk</a> icon pack.</p>
<p><strong>Update:</strong> This guy is a machine, he&#8217;s now at 2,800 icons in this amazing pack</p>
<p><a href="http://pinvoke.com"><img src="http://jonathancremin.com/wp-content/uploads/2008/08/fugue.png" alt="" title="fugue" width="450" height="373" class="no-border" style="background: #fff" /></a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2008/08/07/fugue-icon-pack-953-free-icons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Amazon S3 for backups</title>
		<link>http://crem.in/2008/08/06/using-amazon-s3-for-backups/</link>
		<comments>http://crem.in/2008/08/06/using-amazon-s3-for-backups/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 11:42:18 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[www]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cloud storage]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://crem.in/?p=34</guid>
		<description><![CDATA[It became clear early on in the planning stages of our current project that we were going to need a reliable backup solution. We discussed backing up to another server we already have in the datacenter and backing up to a server in another datacenter. The former was not redundant enough for our liking and [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>It became clear early on in the planning stages of our current project that we were going to need a reliable backup solution. We discussed backing up to another server we already have in the datacenter and backing up to a server in another datacenter. The former was not redundant enough for our liking and the latter would introduce extra costs we could do without so early on.</p>
<p>Enter <a href="http://aws.amazon.com/s3">Amazon S3</a>. You pay for as little as you need and it expands as you do. The S3 docs point to <a href="http://undesigned.org.za/2007/10/22/amazon-s3-php-class">undesigned&#8217;s</a> PHP5 library using cURL. Perfect. 15 minutes and about 10 lines of code later we were archiving and backing up user content to S3.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://crem.in/2008/08/06/using-amazon-s3-for-backups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
