<?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>Chris Hardcastle &#187; php</title>
	<atom:link href="http://chrishardcastle.co.uk/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://chrishardcastle.co.uk</link>
	<description>Techical developer for websites in London</description>
	<lastBuildDate>Wed, 14 Oct 2009 20:26:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A newbie to Ruby</title>
		<link>http://chrishardcastle.co.uk/a-newbie-to-ruby</link>
		<comments>http://chrishardcastle.co.uk/a-newbie-to-ruby#comments</comments>
		<pubDate>Wed, 14 Oct 2009 20:26:48 +0000</pubDate>
		<dc:creator>chris.hardcastle</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://chrishardcastle.co.uk/?p=99</guid>
		<description><![CDATA[My total exposure to Ruby has been around 2 hours, a great time to write about it. So warnings, n00b alert, I have not even written a ruby &#8220;hello world&#8221; script! But hey, it&#8217;s important to write when you feel inspired. I have a few people to thank for the inspiration.
Given a short code demo, [...]]]></description>
			<content:encoded><![CDATA[<p>My total exposure to Ruby has been around 2 hours, a great time to write about it. So warnings, n00b alert, I have not even written a ruby &#8220;hello world&#8221; script! But hey, it&#8217;s important to write when you feel inspired. I have a few people to thank for the inspiration.<span id="more-99"></span></p>
<p>Given a short code demo, it looks very flexible. It can be used to build things extremely quickly. In just a few key strokes, a model, view and controller is automatically created in the file system. Another command will quickly update the database to describe the properties of your newly created entity in its own table.</p>
<p>This bares some similarities with the PHP framework <a href="http://www.symfony-project.org">Symfony</a>. You can auto generate the entities of your system in a very similar way. But I am a PHP freak, why am I so interested in this? It&#8217;s always good to have another arrow to your bow. Also, I think it&#8217;s an important message to those who want to try out programming for web applications. Perhaps students or in some cases, people who have been stuck using classic VB for the past 5 years!</p>
<p>Some may say that using the <a href="http://rubyonrails.org/">Ruby on Rails framework</a> the auto generation of code is unwise. Unwieldy and unmanageable and I would tend to agree with them. However, perhaps it has some uses for prototyping an idea or a technical draft. If the specification or idea keeps changing, then its a perfect match. I am not sure if you can do this but, since its heavy on MVC, components of the system can be replaced (if necessary) with whatever means necessary.  </p>
<p>It&#8217;s meant to be easier to develop with it in Linux and Mac than Windows. Saying that there&#8217;s a package for the <a href="http://aptana.com">Aptana</a> editing suite for Windows that seems well suited to Ruby. There&#8217;s an online demo of Ruby, somewhere on the Internet, I will post it as soon as I remember where it is.</p>
<p>Perhaps in a few years, I will read this again on a site that I built in Ruby, years from now. But for now, I don&#8217;t think I will start learning Ruby just yet. There&#8217;s plenty of other things I would like to do first, that could change.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrishardcastle.co.uk/a-newbie-to-ruby/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress site preview</title>
		<link>http://chrishardcastle.co.uk/wordpress-site-preview</link>
		<comments>http://chrishardcastle.co.uk/wordpress-site-preview#comments</comments>
		<pubDate>Wed, 17 Jun 2009 00:26:13 +0000</pubDate>
		<dc:creator>chris.hardcastle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://chrishardcastle.co.uk/?p=48</guid>
		<description><![CDATA[Once you have finished building a Wordpress based website. Wouldn&#8217;t it be great to test it on the live website host, without interrupting any existing files or pages? This is just the kind of scenario that I have been asked about in the past. So, I have recently developed my own suggestion as to how [...]]]></description>
			<content:encoded><![CDATA[<p>Once you have finished building a Wordpress based website. Wouldn&#8217;t it be great to test it on the live website host, without interrupting any existing files or pages? This is just the kind of scenario that I have been asked about in the past. So, I have recently developed my own suggestion as to how this can be achieved.<br />
<span id="more-48"></span><br />
Once your Wordpress database has been set up and all the files for the site are in place. The next step is to replace the existing index.php / html file with the one from the root of your Wordpress build. From that moment Wordpress with be in control of all incoming requests to your site.</p>
<p>Given that the existing home page has to remain the same until your ready to &#8220;activate&#8221; the new one. You can modify the .htaccess file so the Wordpress site will only respond if the homepage has been called with a particular query string. This means you can test the Wordpress build without interrupting the main index page. </p>
<p>In order to do this, you have to modify your .htaccess file in the website root. Below is the modified .htaccess file, take a backup before testing!</p>
<p><code><br />
# BEGIN WordPress<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteCond %{REQUEST_URI} !^/wp-content/<br />
RewriteCond %{REQUEST_URI} !^/wp-includes/<br />
RewriteRule . /$1/?test=true [L]<br />
# END WordPress<br />
</code></p>
<p>Replace your existing .htaccess file with the code above and you are half way. Next modify your index.php in the wordpress site.</p>
<p><code><br />
if(isset($_GET["test"])){<br />
    define('WP_USE_THEMES', true);<br />
    /* Loads the WordPress Environment and Template */<br />
    require('./wp-blog-header.php');<br />
}else{<br />
    /* Your holding page HTML / include file */<br />
}<br />
</code></p>
<p>You can redirect to, or include the existing index page within the else clause as described above. The links should still be intact because the .htaccess file is appending your url with the required query string.</p>
<p>So when you visit the site your existing homepage should remain the same. When you visit http://yoursite.com<strong>/?test=true</strong> your wordpress site should wake up and run accordingly. </p>
]]></content:encoded>
			<wfw:commentRss>http://chrishardcastle.co.uk/wordpress-site-preview/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>youTube data API</title>
		<link>http://chrishardcastle.co.uk/you-tube-data-api</link>
		<comments>http://chrishardcastle.co.uk/you-tube-data-api#comments</comments>
		<pubDate>Thu, 14 May 2009 21:24:00 +0000</pubDate>
		<dc:creator>chris.hardcastle</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[youtube]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://hardcastle.local.net:8080/?p=12</guid>
		<description><![CDATA[Google provides an API for access to video data that they host under youtube.com. It&#8217;s available from Zend, the PHP company. The package can be downloaded and used for a range of different services. I have been trying it out by pulling in a video and showing it in the sidebar.
]]></description>
			<content:encoded><![CDATA[<p>Google provides an API for access to video data that they host under youtube.com. It&#8217;s available from Zend, the PHP company. The package <a href='http://framework.zend.com/download/gdata/'>can be downloaded</a> and used for a range of different services. I have been trying it out by pulling in a video and showing it in the sidebar.</p>
]]></content:encoded>
			<wfw:commentRss>http://chrishardcastle.co.uk/you-tube-data-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
