<?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>Akra's DevNotes</title>
	<atom:link href="http://akrabat.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://akrabat.com</link>
	<description>Developing PHP software in the Real World, by Rob Allen</description>
	<lastBuildDate>Tue, 09 Feb 2010 09:05:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mobile web monopoly</title>
		<link>http://akrabat.com/opinion/mobile-web-monopoly/</link>
		<comments>http://akrabat.com/opinion/mobile-web-monopoly/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 09:05:18 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=932</guid>
		<description><![CDATA[There's a recent post by Peter-Paul Koch called The iPhone obsession about how Mobile Safari is being treated by web developers as the only web browser to develop for. PPK likens this to how we all used to only develop for IE6. Unfortunately, the article has lots of hyperbole and iPhone hate which significantly detracts [...]]]></description>
			<content:encoded><![CDATA[<p>There's a recent post by Peter-Paul Koch called <a href="http://www.quirksmode.org/blog/archives/2010/02/the_iphone_obse.html">The iPhone obsession</a> about how Mobile Safari is being treated by web developers as the only web browser to develop for. PPK likens this to how we all used to only develop for IE6. Unfortunately, the article has lots of hyperbole and iPhone hate which significantly detracts from the actual message. </p>
<p>The fundamental point is that Mobile Safari is not the only web browser available on phones and if you are serious about providing mobile web to your users, then developing for the other 85% should be part of your modus operandi.</p>
<p>However (and there's always a however!) it's not easy. It's trivial for me to have multiple web browsers and multiple operating systems on one computer for testing. It is not trivial for me to have 10 phones with different browsers and screen sizes. We don't do enough mobile work to justify the costs.</p>
<p>What actually annoyed me was Rentzch's <a href="http://rentzsch.tumblr.com/post/378102588/iphone-isnt-the-new-ie6">response</a>. Rentzch started by saying that Koch's argument was "stupid/lazy/undisciplined" and then goes on to say:</p>
<blockquote><p>I see a quiet revolution of mobile developers waiting for other phones to catch up to the iPhone.</p></blockquote>
<p> and<br />
<blockquote> I think mobile developers intuitively grasp that accommodating the insufficient software+hardware of non-iPhones out there will only prolong the status quo, extending needless suffering for developers and users alike.</p></blockquote>
<p>That's exactly what we all said when we wanted Netscape 4 to die because IE was so much better. Rentzch has made Koch's point for for him whilst trying to disagree.</p>
<p>For what it's worth, I think that any mobile device manufacturer who wants web developers to develop for their device's browser, should provide hardware that doesn't need a plan. It doesn't even need to be a phone. Mobile Safari is the easiest mobile browser to test against as it's available in the iPod Touch.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/opinion/mobile-web-monopoly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework Tutorial for ZF 1.10</title>
		<link>http://akrabat.com/zend-framework/zend-framework-tutorial-for-zf-1-10/</link>
		<comments>http://akrabat.com/zend-framework/zend-framework-tutorial-for-zf-1-10/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 21:52:07 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=928</guid>
		<description><![CDATA[Zend Framework 1.10, was released a week or so ago.
As a result, I have updated my Zend Framework tutorial so that it is completely current. The main change I made was to remove the _init methods in the Bootstrap as they are no longer needed. I also take advantage of the new features of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://framework.zend.com/">Zend Framework 1.10</a>, was released a week or so ago.</p>
<p>As a result, I have updated my <a href="http://akrabat.com/zend-framework-tutorial">Zend Framework tutorial</a> so that it is completely current. The main change I made was to remove the _init methods in the Bootstrap as they are no longer needed. I also take advantage of the new features of the <tt>zf</tt> tool to enable layouts and create forms. It's a shame that it gets the class name of the form wrong though!</p>
<p><img src="http://akrabat.com/wp-content/uploads/zf-tutorial_17-300x240.png" alt="Screen short of Zend Framework tutorial" title="Listing albums in Zend Framework tutorial" width="300" height="240" class="alignright" /></p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/zend-framework/zend-framework-tutorial-for-zf-1-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting email whilst developing</title>
		<link>http://akrabat.com/php/redirecting-email-whilst-developing/</link>
		<comments>http://akrabat.com/php/redirecting-email-whilst-developing/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 07:25:02 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=906</guid>
		<description><![CDATA[One common problem whilst developing is that you don't want to send emails out to the client (or their clients!). Ideally, we want to alter our development environment so that this doesn't happen, but still allows us to test the contents of emails that are sent by our web applications.
Windows
On Windows, the mail() function uses [...]]]></description>
			<content:encoded><![CDATA[<p>One common problem whilst developing is that you don't want to send emails out to the client (or their clients!). Ideally, we want to alter our development environment so that this doesn't happen, but still allows us to test the contents of emails that are sent by our web applications.</p>
<h3>Windows</h3>
<p>On Windows, the <tt>mail()</tt> function uses SMTP over port 25. Unless you've changed your php.ini file, then it will try to connect to localhost in order to send an email. On Windows VM, I use <a href="http://www.lastcraft.com/fakemail.php">Fakemail</a>. This is an SMTP mail server written in perl (or python) that store emails as files into a given directory. When your web application sends an email, you check in the directory and look at the files created.  One top tip: alter the script to give each file a <tt>.txt</tt> extension. Then you can double click :)</p>
<p>Fakemail is also very useful in Linux/Mac if you are using the SMTP transport mail in Zend_Mail or Swiftmailer or whatever.</p>
<h3>Linux / OS X</h3>
<p>On the *nix based systems, <tt>mail()</tt> sends email using an application on the system called <em>sendmail</em> (or any number of compatible alternatives). By default it will call the <tt>sendmail</tt> binary, however you can change this in your php.ini with the <tt>sendmail_path</tt> setting. </p>
<p>I set my development boxes like this:</p>
<pre class="phpcode"><span style="color: #0000BB">
sendmail_path&nbsp;</span><span style="color: #007700">=&nbsp;/</span><span style="color: #0000BB">usr</span><span style="color: #007700">/</span><span style="color: #0000BB">local</span><span style="color: #007700">/</span><span style="color: #0000BB">bin</span><span style="color: #007700">/</span><span style="color: #0000BB">trapmail
</span>
</span></code></pre>
<p>Now, mail() will call my <tt>trapmail</tt> script. This script is trivial:</p>
<pre class="phpcode"><span style="color: #0000BB">
formail&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">R&nbsp;cc&nbsp;X</span><span style="color: #007700">-</span><span style="color: #0000BB">original</span><span style="color: #007700">-</span><span style="color: #0000BB">cc&nbsp;
&nbsp;&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">R&nbsp;to&nbsp;X</span><span style="color: #007700">-</span><span style="color: #0000BB">original</span><span style="color: #007700">-</span><span style="color: #0000BB">to&nbsp;
&nbsp;&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">R&nbsp;bcc&nbsp;X</span><span style="color: #007700">-</span><span style="color: #0000BB">original</span><span style="color: #007700">-</span><span style="color: #0000BB">bcc&nbsp;
&nbsp;&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">f&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">A</span><span style="color: #DD0000">"To:&nbsp;rob@akrabat.com"&nbsp;
</span><span style="color: #007700">|&nbsp;/</span><span style="color: #0000BB">usr</span><span style="color: #007700">/</span><span style="color: #0000BB">sbin</span><span style="color: #007700">/</span><span style="color: #0000BB">sendmail&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">t&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">i
</span>
</span></code></pre>
<p>This script causes all emails to be redirect to my email address with the original to, cc and bcc fields renamed in the headers, so they can be checked!. I like this solution even better than Fakemail as it's easier to see exactly what the mail looks like in a mail client, especially for HTML format.</p>
<p>I just wish I had thought of this script myself! However <a href="http://seancoates.com/mail-replacement----a-better-hack">Sean Coates</a> came up with the idea in 2005 and I've been using it every since. </p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/php/redirecting-email-whilst-developing/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Determining if a ZF view helper exists</title>
		<link>http://akrabat.com/zend-framework/determining-if-a-zf-view-helper-exists/</link>
		<comments>http://akrabat.com/zend-framework/determining-if-a-zf-view-helper-exists/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 16:38:14 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=900</guid>
		<description><![CDATA[This is another one of those posts that exists as a record for me so I can find it again if i need it!
If you need to know whether a view helper exists before you call it, one way is to write a simple view helper to tell you:

class&#160;App_View_Helper_HelperExists&#160;extends&#160;Zend_View_Helper_Abstract
{
&#160;&#160;&#160;&#160;function&#160;helperExists($name)&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;(bool)$this-&#62;view-&#62;getPluginLoader('helper')-&#62;load($name,&#160;false);
&#160;&#160;&#160;&#160;}
}


You can then use it in a [...]]]></description>
			<content:encoded><![CDATA[<p>This is another one of those posts that exists as a record for me so I can find it again if i need it!</p>
<p>If you need to know whether a view helper exists before you call it, one way is to write a simple view helper to tell you:</p>
<pre class="phpcode"><span style="color: #0000BB">
</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">App_View_Helper_HelperExists&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Zend_View_Helper_Abstract
</span><span style="color: #007700">{
&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;</span><span style="color: #0000BB">helperExists</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(bool)</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPluginLoader</span><span style="color: #007700">(</span><span style="color: #DD0000">'helper'</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;}
}
</span>
</span></code></pre>
<p>You can then use it in a view scripts like this:</p>
<pre class="phpcode">
<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">helperExists</span><span style="color: #007700">(</span><span style="color: #DD0000">'doMagic'</span><span style="color: #007700">))&nbsp;{&nbsp;echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">doMagic</span><span style="color: #007700">();&nbsp;}&nbsp;</span><span style="color: #0000BB">?&gt;
</span>
</span></code></pre>
<p>As Jeremy mentions in the comments, this code came out of a discussion on the <a href="http://www.phpnw.org.uk/">PHPNW</a> IRC channel #phpnw</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/zend-framework/determining-if-a-zf-view-helper-exists/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Custom Zend_Application Resources</title>
		<link>http://akrabat.com/zend-framework/custom-zend_application-resources/</link>
		<comments>http://akrabat.com/zend-framework/custom-zend_application-resources/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 07:12:57 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=889</guid>
		<description><![CDATA[Sooner or later, you want to leverage Zend_Application better by creating your own resource plugins. This lets you reuse your initialisation work in multiple application that much easier and keeps your Boostrap class that much shorter!
In my case, I wanted to create a resource for CouchDb that checked that the database was created and if [...]]]></description>
			<content:encoded><![CDATA[<p>Sooner or later, you want to leverage <a href="http://weierophinney.net/matthew/archives/230-Quick-Start-to-Zend_Application_Bootstrap.html"><tt>Zend_Application</tt></a> better by creating your own resource plugins. This lets you reuse your initialisation work in multiple application that much easier and keeps your Boostrap class that much shorter!</p>
<p>In my case, I wanted to create a resource for <a href="http://couchdb.apache.org/">CouchDb</a> that checked that the database was created and if not, create it.</p>
<p>Creating your own plugin is easy enough. The obvious place is library/App/Application/Resource and a typical resource would look like this:</p>
<pre class="phpcode"><span style="color: #0000BB">
</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">App_Application_Resource_Couchdb&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Zend_Application_Resource_ResourceAbstract
</span><span style="color: #007700">{
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">/**
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Defined&nbsp;by&nbsp;Zend_Application_Resource_Resource
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;Phly_Couch|null
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;do&nbsp;stuff&nbsp;here&nbsp;to&nbsp;init&nbsp;CouchDB
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOptions</span><span style="color: #007700">();&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;$options&nbsp;contains&nbsp;everything&nbsp;under&nbsp;'resources.couchdb'&nbsp;in&nbsp;application.ini
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}
}
</span>
</span></code></pre>
<p>You then need to tell Zend_Application about your new plugins. This is done with this line in application.ini:</p>
<pre class="phpcode"><span style="color: #0000BB">
pluginPaths</span><span style="color: #007700">.</span><span style="color: #0000BB">App_Application_Resource_&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"App/Application/Resource"
</span>
</span></code></pre>
<p>You can now have as many resource plugins as you like within the <tt>App_Application_Resource_</tt> class-space.</p>
<p>Also, Matthew Weier O'Phinney has also written an article on <a href="http://www.weierophinney.net/matthew/archives/230-Quick-Start-to-Zend_Application_Bootstrap.html">Zend_Application</a> which you should read too.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/zend-framework/custom-zend_application-resources/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Framework on a shared host</title>
		<link>http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/</link>
		<comments>http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 07:31:24 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=873</guid>
		<description><![CDATA[When you deploy a Zend Framework website to a shared host, you usually cannot change the DocumentRoot to point at the public/ folder of the website. As a result the URL to the website is now http://www.example.com/public/. This doesn't look very professional, so we'd like to remove it.
The easiest way, given a ZF project created [...]]]></description>
			<content:encoded><![CDATA[<p>When you deploy a Zend Framework website to a shared host, you usually cannot change the DocumentRoot to point at the <tt>public/</tt> folder of the website. As a result the URL to the website is now http://www.example.com/public/. This doesn't look very professional, so we'd like to remove it.</p>
<p>The easiest way, given a ZF project created using <tt>Zend_Tool</tt> is this:</p>
<h3>Create /index.php</h3>
<pre class="phpcode">
<span style="color: #0000BB">&lt;?php&nbsp;
define</span><span style="color: #007700">(</span><span style="color: #DD0000">'RUNNING_FROM_ROOT'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);
include&nbsp;</span><span style="color: #DD0000">'public/index.php'</span><span style="color: #007700">;
</span>
</span></code></pre>
<p>This uses the <tt>index.php</tt> already created by <tt>Zend_Tool</tt> and means that we don't have to change anything if we move to a VPS host where we can set the DocumentRoot directly to <tt>public/</tt>.</p>
<h3>Create /.htaccess</h3>
<p></code>
<pre class="phpcode"><span style="color: #0000BB">
SetEnv&nbsp;APPLICATION_ENV&nbsp;development

RewriteEngine&nbsp;On
RewriteRule&nbsp;</span><span style="color: #007700">.*&nbsp;</span><span style="color: #0000BB">index</span><span style="color: #007700">.</span><span style="color: #0000BB">php
</span>
</span></code></pre>
<p>We create a <tt>.htaccess</tt> file that redirects every request to index.php. We want to do this so that no one can try and read <tt>application/configs/application.ini</tt>.  Obviously, set the <tt>APPLICATION_ENV</tt> to the correct value!</p>
<h3>Referencing public facing files</h3>
<p>Having created a very aggressive, rewrite rule, what about CSS/JS/image files though? </p>
<p>Fortunately, we already have a <tt>.htaccess</tt> file in the <tt>public/</tt> folder that correctly handles this situation. As Apache will execute the .htaccess files in the deepest directory it finds, any reference to a public facing file within the <tt>public/</tt> folder will correctly be served.</p>
<p>You do have to be aware of this when referencing public facing files though and add the <tt>/public</tt> to the baseUrl yourself. </p>
<p>For example, you may set up your CSS file and other view settings within a Front Controller plugin like this:</p>
<pre class="phpcode"><span style="color: #0000BB">
</span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">App_Controller_Plugin_View&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Zend_Controller_Plugin_Abstract
</span><span style="color: #007700">{
&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">dispatchLoopStartup</span><span style="color: #007700">(</span><span style="color: #0000BB">Zend_Controller_Request_Abstract&nbsp;$request</span><span style="color: #007700">)
&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$frontController&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Zend_Controller_Front</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance</span><span style="color: #007700">();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$view&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$frontController</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getParam</span><span style="color: #007700">(</span><span style="color: #DD0000">'bootstrap'</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">getResource</span><span style="color: #007700">(</span><span style="color: #DD0000">'view'</span><span style="color: #007700">);&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$view</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">doctype</span><span style="color: #007700">(</span><span style="color: #DD0000">'XHTML1_STRICT'</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$baseUrl&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getBaseUrl</span><span style="color: #007700">();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">defined</span><span style="color: #007700">(</span><span style="color: #DD0000">'RUNNING_FROM_ROOT'</span><span style="color: #007700">))&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$baseUrl&nbsp;</span><span style="color: #007700">.=&nbsp;</span><span style="color: #DD0000">'/public'</span><span style="color: #007700">;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$view</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">headLink</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">appendStylesheet</span><span style="color: #007700">(</span><span style="color: #0000BB">$baseUrl&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/css/main.css'</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$view</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">headLink</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">appendStylesheet</span><span style="color: #007700">(</span><span style="color: #0000BB">$baseUrl&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/css/screen.css'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'screen'</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$view</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">headLink</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">appendStylesheet</span><span style="color: #007700">(</span><span style="color: #0000BB">$baseUrl&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'/css/print.css'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'print'</span><span style="color: #007700">);
&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;
}
</span>
</span></code></pre>
<p><span style="font-size: 0.95em;">(This code assumes you have added a <tt>resources.view[] = ""</tt> to your application.ini)</span></p>
<p>As we have a constant that tells us if we're running from the root, we can dynamically add the <tt>/public</tt> into the URL. If we change to a host where the DocumentRoot is set directly to the <tt>public/</tt> folder, then we don't need to change our code.</p>
<p>That's it. Your Zend Framework application works nicely with shared hosts.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/zend-framework/zend-framework-on-a-shared-host/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Speaking at TEK·X</title>
		<link>http://akrabat.com/conferences/speaking-at-tek%c2%b7x/</link>
		<comments>http://akrabat.com/conferences/speaking-at-tek%c2%b7x/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 23:16:16 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=886</guid>
		<description><![CDATA[I'm delighted to be able to announce that I'm speaking at TEK X in May, in Chicago. This is one of the big US PHP conferences and I feel privileged to be invited.
I'll be concentrating on Zend Framework with a tutorial called "Building a Zend Framework application" and a talk on "Working with Zend_Form". After [...]]]></description>
			<content:encoded><![CDATA[<p>I'm delighted to be able to announce that I'm speaking at <a href="http://tek.phparch.com/">TEK X</a> in May, in Chicago. This is one of the big US PHP conferences and I feel privileged to be invited.</p>
<p>I'll be concentrating on Zend Framework with a tutorial called "Building a Zend Framework application" and a talk on "Working with Zend_Form". After a couple of less technical talks recently, it'll be fun to dive into strongly technical content. Hopefully, I'll be able to explain Zend_Form well enough that people will understand it too! </p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/conferences/speaking-at-tek%c2%b7x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pragmatic Version Control Using Git</title>
		<link>http://akrabat.com/review/pragmatic-version-control-using-git/</link>
		<comments>http://akrabat.com/review/pragmatic-version-control-using-git/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 10:32:11 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=867</guid>
		<description><![CDATA[I've recently been looking at different version control systems, specifically distributed ones like git, Bazaar and Mercurial. At IPC I was talking to Travis Swicegood about wanting to learn and he very kindly organised a copy of his book for me to review and learn from.
I didn't know much about git at all before reading [...]]]></description>
			<content:encoded><![CDATA[<p>I've recently been looking at different version control systems, specifically distributed ones like <a href="http://www.kernel.org/pub/software/scm/git/docs/git.html">git</a>, <a href="http://bazaar.canonical.com/en/">Bazaar</a> and <a href="http://mercurial.selenic.com/wiki/">Mercurial</a>. At IPC I was talking to <a href="">Travis Swicegood</a> about wanting to learn and he very kindly organised a copy of his <a href="http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git">book</a> for me to review and learn from.</p>
<p>I didn't know much about git at all before reading the book. I do now :)</p>
<p>It turns out that git is fairly easy when you have a good explanation of how to use it. The book starts from the basics of what version control is, which I already knew. It was good to see equal coverage of how to set up git in Windows, OSX and Linux. I was aware that Windows support wasn't prime-time, but at least doable with msys. </p>
<p>The bulk of the book covers how to actually use git and this is where I learnt enough about git to actually understand it. There were two main surprises for me:</p>
<ul>
<li>You need to re-add a modified file every time you want to commit it. This puts it in the <em>staging area</em>. Fortunately the <tt>-a</tt> switch to <tt>git add</tt> will auto-add for you!</li>
<li>Directories are not stored under version control. It's like CVS :)</li>
</ul>
<p>Other than that, it's just like Subversion, only faster! (You also have that distributed thing going on.)</p>
<p>I suck at reviewing. </p>
<p><a href="http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git">Pragmatic Version Control Using Git</a> is a very good book if you want to learn git. </p>
<p>It's even better as a reference book as you can actually find things in it too. </p>
<p>If you want to know all there is to know about git, then get this book. </p>
<p>Even the paper feels good in your hand when you turn the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/review/pragmatic-version-control-using-git/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>2009 end-of-year wrap-up</title>
		<link>http://akrabat.com/me/2009-end-of-year-wrap-up/</link>
		<comments>http://akrabat.com/me/2009-end-of-year-wrap-up/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 16:54:46 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[Me]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=850</guid>
		<description><![CDATA[Like last year, my wrap up is mostly an excuse to show off some of the photos I took in 2009!
January
Other than the snow, The big thing that happened in January was that an article I wrote was published in php&#124;architect.

February
We had daffodils in snow at the start of this month and then towards the [...]]]></description>
			<content:encoded><![CDATA[<p>Like <a href="http://akrabat.com/me/2007-end-of-year-wrap-up/">last year</a>, my wrap up is mostly an excuse to show off some of the photos I took in 2009!</p>
<h3>January</h3>
<p>Other than the <a href="http://www.flickr.com/photos/akrabat/3170344038/">snow</a>, The big thing that happened in January was that an article I wrote was published in <a href="http://www.flickr.com/photos/akrabat/3170344038/">php|architect</a>.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3196817670" title="View 'My php|architect article in the Jan 2009 issue' on Flickr.com"><img border="0" width="500" alt="My php|architect article in the Jan 2009 issue" src="http://farm4.static.flickr.com/3374/3196817670_b1e1345a80.jpg" height="333"/></a></p>
<h3>February</h3>
<p>We had <a href="http://www.flickr.com/photos/akrabat/3255469854/">daffodils in snow</a> at the start of this month and then towards the end, the PHPUK conference took place.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3316677497" title="View 'Paying attention during Chris' talk' on Flickr.com"><img border="0" width="500" alt="Paying attention during Chris' talk" src="http://farm4.static.flickr.com/3412/3316677497_cf1856be0c.jpg" height="291"/></a></p>
<h3>March</h3>
<p>Spring <a href="http://www.flickr.com/photos/akrabat/3328041197/">arrived</a> in March. The <a href="http://www.svr.co.uk/">Severn Valley Railway</a> had its Festival of Steam gala, and I took a day off so that I could photograph it.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3333998682" title="View 'Festival of Steam at the SVR' on Flickr.com"><img border="0" width="500" alt="Festival of Steam at the SVR" src="http://farm4.static.flickr.com/3076/3333998682_60902d0ae5.jpg" height="333"/></a></p>
<h3>April</h3>
<p>A month of <a href="http://www.flickr.com/photos/akrabat/3424046095/">punctures</a>. I went to a Microsoft community event in London too.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3450353899" title="View 'Scott and Derick' on Flickr.com"><img border="0" width="500" alt="Scott and Derick" src="http://farm4.static.flickr.com/3409/3450353899_12c753f056.jpg" height="333"/></a></p>
<h3>May</h3>
<p>This is <a href="http://www.flickr.com/photos/akrabat/3507471473/">birthday</a> <a href="http://www.flickr.com/photos/akrabat/3522181495/">month</a> in our household. It was also our first trip away camping this year.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3563290555" title="View 'Camping' on Flickr.com"><img border="0" width="500" alt="Camping" src="http://farm3.static.flickr.com/2469/3563290555_1d9ff91c4d.jpg" height="238"/></a></p>
<h3>June</h3>
<p>What little good weather we had this year, was in <a href="http://www.flickr.com/photos/akrabat/3586780504/">June</a>.  I popped up to Manchester for a <a href="http://www.phpnw.org.uk/">PHPNW</a> meet. <a href="http://www.phpconference.nl/2009">DPC 09</a> was also held in June and I spoke on caching.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3634188361" title="View 'Cal and Ivo interview Andrei' on Flickr.com"><img border="0" width="500" alt="Cal and Ivo interview Andrei" src="http://farm4.static.flickr.com/3361/3634188361_0ac16d3672.jpg" height="334"/></a></p>
<h3>July</h3>
<p>We finished <a href="http://www.flickr.com/photos/akrabat/3686663971/">decorating</a> the living room in July. We also had a week's holiday in Wales.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3792852995" title="View 'Cilgerran Castle' on Flickr.com"><img border="0" width="500" alt="Cilgerran Castle" src="http://farm4.static.flickr.com/3485/3792852995_f03d4fb95c.jpg" height="333"/></a></p>
<h3>August</h3>
<p>I started using a <a href="http://www.flickr.com/photos/akrabat/3794536187/">Wacom tablet</a> in August as I was getting a pain in my wrist. August is school holiday month, so we went away for another week, to Cumbria.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3866633541" title="View 'Old van at the pencil museum' on Flickr.com"><img border="0" width="500" alt="Old van at the pencil museum" src="http://farm3.static.flickr.com/2506/3866633541_836787b84d.jpg" height="333"/></a></p>
<h3>September</h3>
<p>We sold our <a href="http://www.flickr.com/photos/akrabat/3929743352/">Pathfinder</a> in September and didn't do much else. I took the kids to visit to the <a href="http://www.gwsr.com/">Gloucestershire Warwickshire Railway</a> during the month too.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/3934411321" title="View 'Giving up the token' on Flickr.com"><img border="0" width="334" alt="Giving up the token" src="http://farm3.static.flickr.com/2639/3934411321_1886d31a24.jpg" height="500"/></a></p>
<h3>October</h3>
<p>PHP Conference season started again for me with <a href="http://conference.phpnw.org.uk/phpnw09/">PHPNW 09</a>. I spoke on project management.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/4012911175" title="View 'Kevlin's keynote was excellent' on Flickr.com"><img border="0" width="333" alt="Kevlin's keynote was excellent" src="http://farm4.static.flickr.com/3120/4012911175_4cb94f2f7e.jpg" height="500"/></a></p>
<h3>November</h3>
<p>Another month, two conferences! <a href="http://zendcon.com/2009/">ZendCon</a> 09 where I gave a tutorial on the <a href="http://www.zend.com/en/services/certification/framework/">Zend Framework certification</a> and spoke on project management. I also visited <a href="http://www.flickr.com/photos/akrabat/4122568204/">Alcatraz</a>. <a href="http://it-republik.de/php/phpconference09/">IPC 09</a> was also held in November, where I spoke on caching and deployment.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/4064803153" title="View 'Andi wraps up ZendCon 09' on Flickr.com"><img border="0" width="500" alt="Andi wraps up ZendCon 09" src="http://farm3.static.flickr.com/2510/4064803153_99cbb01195.jpg" height="333"/></a></p>
<h3>December</h3>
<p>The final month of the year saw me working way too hard. We did take the kids to see Santa though.</p>
<p><a href="http://www.flickr.com/photos/86569608@N00/4163759978" title="View 'Teddy Bears' on Flickr.com"><img border="0" width="500" alt="Teddy Bears" src="http://farm3.static.flickr.com/2504/4163759978_2ecdbbdace.jpg" height="210"/></a></p>
<p>Here's to 2010!</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/me/2009-end-of-year-wrap-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Advent 2009: On deployment</title>
		<link>http://akrabat.com/php/php-advent-2009-on-deployment/</link>
		<comments>http://akrabat.com/php/php-advent-2009-on-deployment/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 08:33:11 +0000</pubDate>
		<dc:creator>Rob...</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://akrabat.com/?p=843</guid>
		<description><![CDATA[This year I was asked to write an article for PHP Advent 2009 an it's now been published!
Automate your Deployment is a look at how to automate the process of deploying your application to the web server. At my company we started automating our deployment systems just over a year and the number of issues [...]]]></description>
			<content:encoded><![CDATA[<p>This year I was asked to write an article for PHP Advent 2009 an it's now been published!</p>
<p><a href="http://phpadvent.org/2009/automate-your-deployment-by-rob-allen">Automate your Deployment</a> is a look at how to automate the process of deploying your application to the web server. At my company we started automating our deployment systems just over a year and the number of issues we have around deployment of new code to a website has dropped considerably and is no longer a stressful event. </p>
<p>If you aren't currently using an automated deployment script, I can't recommend highly enough that you set yourself a New Year's resolution to investigate the options and implement a system for yourself.</p>
]]></content:encoded>
			<wfw:commentRss>http://akrabat.com/php/php-advent-2009-on-deployment/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
