<?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>Conceptric &#187; php</title>
	<atom:link href="http://www.conceptric.co.uk/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.conceptric.co.uk</link>
	<description>Ideas and Applications</description>
	<lastBuildDate>Thu, 11 Feb 2010 20:51:57 +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>Switching to Rails</title>
		<link>http://www.conceptric.co.uk/switching-to-rails.htm</link>
		<comments>http://www.conceptric.co.uk/switching-to-rails.htm#comments</comments>
		<pubDate>Sun, 30 Aug 2009 18:30:00 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Personal Perspectives]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.conceptric.co.uk/?p=302</guid>
		<description><![CDATA[I know that a good developer should choose the best tool for the job in hand, but their own productivity and inspiration must inform the decision in selecting the best tool.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a personal project based on CodeIgniter and it&#8217;s been uphill work. I finally lost patience with both the framework and language and followed the advice given on <a href="http://www.conceptric.co.uk/codeigniter-test-coverage.htm">my last post about code testing</a>.</p>
<p>I&#8217;ve used Ruby for scripting, and deploying PHP applications with custom Capistrano recipes for years now, but I&#8217;ve never tried any of the available web frameworks. </p>
<p>This week I switched to Ruby on Rails, and I&#8217;ve accomplished more in a couple of days than in a couple of months with CodeIgniter.</p>
<p>I&#8217;m not trying to claim that there&#8217;s anything fundamentally wrong with PHP, so don&#8217;t beat me up over it, but I find working with Ruby and Java much more intuitive, enjoyable and productive: it&#8217;s a personal choice, I feel more inspired.</p>
<p>I&#8217;m particularly loving the default support for <a href="http://guides.rubyonrails.org/testing.html">unit, functional and integration testing</a>; I now feel in control of my code and I&#8217;ve yet to explore the full range of testing frameworks and approaches available for Rails. </p>
<p>I know that <a href="http://cakephp.org/">CakePHP</a> mirrors Rails functionality very closely, but I&#8217;m afraid it&#8217;s the PHP language that I find too ugly to love &#8211; personal choice again, don&#8217;t shoot &#8211; consequently this is one developer who may have written his last line of PHP code&#8230;&#8230; maybe.</p>
<p>I&#8217;m now hoping to have the first release of the nature and wildlife recording application I&#8217;ve been promising Clare for&#8230;&#8230; much too long, up and running in the next couple of weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/switching-to-rails.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Capistrano works!</title>
		<link>http://www.conceptric.co.uk/capistrano-works.htm</link>
		<comments>http://www.conceptric.co.uk/capistrano-works.htm#comments</comments>
		<pubDate>Mon, 04 Aug 2008 13:52:10 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[capistrano]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jameswhinfrey.co.uk/?p=66</guid>
		<description><![CDATA[Effective version control and Capistrano managed deployment has hugely enhanced my workflow and quality.]]></description>
			<content:encoded><![CDATA[<p>Deploying even my simplest web applications was a complicated matter:</p>
<ol>
<li>Log in as a privileged user.</li>
<li>Create the domain deployment directory.</li>
<li>Export the application code from Subversion.</li>
<li>Update the file ownership and privileges.</li>
</ol>
<p>For Wordpress I also had to export code for each theme or plug&#8212;in to the required locations. So I decided to improve the situation. I&#8217;ve changed the way my Wordpress sites are handled in Subversion; haven&#8217;t moved to <a href="http://git.or.cz/">Git</a> yet like the rest of the world, and I am using <a href="http://www.capify.org/">Capistrano</a> to manage the deployment.</p>
<p>Capistrano is a Ruby based remote task manager, the most commonly used tasks being for web application deployment. Obviously the original target was Ruby on Rails, but many people use it for PHP. It uses Secure Shell (SSH) as the preferred method for logging into remote servers; all communication is then encrypted.</p>
<p>What follows isn&#8217;t a full set of instructions on deploying PHP with Capistrano, <a href="http://www.hostingrails.com/forums/wiki_thread/46">HostingRails.com</a> provide a useful piece and you should look at the <a href="http://manuals.rubyonrails.org/read/chapter/97">Capistrano manual</a>, these are my thoughts. May be something more detailed might come later&#8230; but no promises.</p>
<h3>Managing the source code.</h3>
<p>The Subversion repository for each blog project uses a <a href="http://svnbook.red-bean.com/en/1.1/ch07s05.html">vendor branch</a> of the Wordpress source code and  svn:externals properties to import the required themes and plug&#8212;ins from their respective repositories. </p>
<p>Wordpress updates are integrated into the vendor branch and then into any of my projects without disturbing any custom code changes. For merging changes I can strongly recommend using the svn_load_dirs.pl script, it allows you to maintain file history and makes the whole process easier.</p>
<h3>And now deploy.</h3>
<p>I currently have my main Subversion and Web servers on the same machine, leaving me with the option to use the local <code>file://</code> protocol to retrieve the application files. I wanted to make my deployment script more universal so that I could use it for the production and development platforms. </p>
<p>The obvious choice was the <code>svn+ssh://</code> protocol I normally use, but in addition to SSH, I use public key authorisation with passphrases for all of my servers. A frequent problem was that Capistrano didn&#8217;t like asking for passphrases for remote machines.</p>
<p>Since the repository and deployment machines are one in the same, I can use SSH forwarding to provide a recursive tunnel by defining the following in the <em>deploy.rb</em> script.</p>
<pre>
<code>set :user, "me" </code>
<code>ssh_options[:forward_agent] = true</code>
</pre>
<p>The variable <code>user</code> tells Capistrano which user has SSH access and the <code>forward_agent</code> option allows the same SSH credentials for the tunnel to the Subversion server. Now , if your svn user is different from the ssh user you&#8217;ll need to add another couple of things: </p>
<pre>
<code>set :svn_user, username</code>
<code>set :repository, "--username #{svn_user} svn+ssh://hostname/repository/#{application}/trunk"</code>
</pre>
<p>These variables enabled me to use the default deployment tasks for my application, there&#8217;s no need to override them, just use the <code>before_</code> and <code>after_</code> hooks to define additional functionality.</p>
<h3>The result.</h3>
<p>I have two WordPress blogs deployed on my server using Capistrano and Subversion for remote control, including custom themes and third&#8212;party plugins. I&#8217;ve already redeployed to incorporate changes and everything has worked perfectly.</p>
<p>Next&#8230; Drupal?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/capistrano-works.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
