<?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>Development Cycle</title>
	<atom:link href="http://www.development-cycle.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.development-cycle.com</link>
	<description>Binary Bits &#38; Pieces</description>
	<lastBuildDate>Tue, 23 Apr 2013 01:47:23 +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>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Changing the web root of a cPanel acccount</title>
		<link>http://www.development-cycle.com/2013/04/changing-the-web-root-of-a-cpanel-acccount/</link>
		<comments>http://www.development-cycle.com/2013/04/changing-the-web-root-of-a-cpanel-acccount/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 01:47:23 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=812</guid>
		<description><![CDATA[As a rule I try to avoid cPanel for hosting sites, I find the overhead of the control panel and the limited flexibility too confining for all but the simplest of sites. Occasionally though I need to deploy sites at work though to cPanel servers due to client requirements. The default web location ( ~/public_html [...]]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-813" style="float: right;" alt="cpanel_logo" src="http://www.development-cycle.com/wp-content/uploads/2013/04/cpanel_logo.jpg" width="324" height="243" />As a rule I try to avoid cPanel for hosting sites, I find the overhead of the control panel and the limited flexibility too confining for all but the simplest of sites. Occasionally though I need to deploy sites at work though to cPanel servers due to client requirements.</p>
<p>The default web location ( ~/public_html ) for an account works well in most instances. But this default can cause issues when deploying certain applications such as Zend Framework. in which you do not want the web server serving the root of application codebase as the site root.<br />
<span id="more-812"></span><br />
A common work around with cPanel environments is to create a .htaccess file in the base of the application to rewrite the path to the public root but this is a bit messy and adds another level to the application URL&#8217;s. Fortunately if you have root SSH access to the cPanel server though the path server by the webserver can be changed simply enough.</p>
<p>To change simply log in to the root account of the server over SSH. Then change into the userdata directory:</p>
<p><em>cd /var/cpanel/userdata/</em></p>
<p>Listing the contents of this directory will show a list of all the cPanel accounts on the machine. From here simply change into the directory with the same name as the account you would like to edit the document root for:</p>
<p><em>cd USERNAME</em></p>
<p>In this directory you will see a file named the same as the domain that belongs to the account. Edit this file and find a line that looks similar to:</p>
<p><em>documentroot: /home/USERNAME/public_html</em></p>
<p>Change the path defined in this line to the public path required by your application and save the changes. Now rebuild the apache configuration for the server with the following command:</p>
<p><em>/scripts/rebuildhttpdconf</em></p>
<p>Then restart the Apache service:</p>
<p><em>service httpd restart</em></p>
<p>Visiting the site after restarting Apache will now show you the account being served from the amended document root.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/04/changing-the-web-root-of-a-cpanel-acccount/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S3 Video 0.97 Released</title>
		<link>http://www.development-cycle.com/2013/04/s3-video-0-97-released/</link>
		<comments>http://www.development-cycle.com/2013/04/s3-video-0-97-released/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 00:05:42 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Release]]></category>
		<category><![CDATA[S3]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=807</guid>
		<description><![CDATA[A new version of the S3 Video (0.97) WordPress plugin has been released to the plugin repository. This release is a combination of some new functionality along with a number of bug fixes. Some of the bigger changes in this release are: Support for Amazon S3 prefixes. This feature allows faster traversal of buckets containing [...]]]></description>
				<content:encoded><![CDATA[<p>A new version of the <a title="S3 Video on the WordPress plugin repository" href="http://wordpress.org/extend/plugins/s3-video/" target="_blank">S3 Video (0.97) WordPress plugin</a> has been released to the plugin repository. This release is a combination of some new functionality along with a number of bug fixes.</p>
<p>Some of the bigger changes in this release are:</p>
<ul>
<li>Support for Amazon S3 prefixes. This feature allows faster traversal of buckets containing a large number of files. This functionality was <a title="Harmag WordPress Profile" href="http://profiles.wordpress.org/harmag/" target="_blank">contributed by Harmag</a>, many thanks!</li>
<li>The addition of some simple tool tip functionality to help less technical users understand some of the terms and functionality.</li>
<li>An issue was resolved that was causing the auto-play functionality to no work when using the videoJS player.</li>
<li>Fixed the broken video preview functionality in the admin back-end</li>
<li>Also resolved and issues preventing multiple videos or play-lists to be embedded within the same pages or post.</li>
</ul>
<p>The new stable version of S3 Video can be downloaded from the <a title="S3 Video on the WordPress plugin repository" href="http://www.development-cycle.com/2013/01/speeding-up-google-sdk-manager-downloads/" target="_blank">WordPress plugin repository page</a>. If you are not as concerned with stability and would like to take advantage of new functionality as soon as it becomes available, the <a title="S3 Video Github Page" href="https://github.com/anthony-mills/s3-video" target="_blank">development branch is also available to clone on github</a>.</p>
<p><strong>Related Posts:</strong></p>
<p><a title="Version 0.96 of S3 Video for WordPress Released" href="http://www.development-cycle.com/2013/01/version-0-96-of-s3-video-for-wordpress-released/" target="_blank">S3 Video 0.96 Released</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/04/s3-video-0-97-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filling device storage with HTML5 localstorage</title>
		<link>http://www.development-cycle.com/2013/03/filling-device-storage-with-html5-localstorage/</link>
		<comments>http://www.development-cycle.com/2013/03/filling-device-storage-with-html5-localstorage/#comments</comments>
		<pubDate>Thu, 28 Feb 2013 23:15:17 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[localstorage]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=793</guid>
		<description><![CDATA[A while back I wrote about using HTML5 local storage engine for storing websites data locally on a client device for caching or off line use. The W3 recommendation on web storage recommends a size limit on the amount of data storage allowed per origin. This has currently been implemented by the major browsers as [...]]]></description>
				<content:encoded><![CDATA[<p><img class="size-full wp-image-794" alt="HTML5_Logo_128" style="float:right;" src="http://www.development-cycle.com/wp-content/uploads/2013/03/HTML5_Logo_128.png" width="128" height="128" />A while back I wrote about using <a title="HTML5 local storage" href="http://www.development-cycle.com/2012/10/html5-offline-storage/" target="_blank">HTML5 local storage engine for storing websites</a> data locally on a client device for caching or off line use. The <a title="w3 web storage recommendations" href="http://www.w3.org/TR/webstorage/" target="_blank">W3 recommendation on web storage</a> recommends a size limit on the amount of data storage allowed per origin. This has currently been implemented by the major browsers as follows:</p>
<ul>
<li>2.5 MB per origin in Google Chrome</li>
<li>5 MB per origin in Mozilla Firefox, Safari and Opera</li>
<li>10 MB per origin in Internet Explorer</li>
</ul>
<p><span id="more-793"></span><br />
The W3 recommendation also states <em>&#8220;User agents should guard against sites storing data under the origins other affiliated sites, e.g. storing up to the limit in a1.example.com, a2.example.com, a3.example.com, etc, circumventing the main example.com storage limit.&#8221;</em>. But according to this site Safari, Chrome, Opera and IE don&#8217;t perform this check. With Firefox being the only one that is a bit smarter about the way things are handled, This allows a domain to have multiple sub domains redirect through them adding some local storage from each effectively filling the devices available storage.</p>
<p>All in all an interesting proof of concept which may be a sign of things to come. With some of the short comings by browser makers and their implementation of new HTML5 features.</p>
<p><strong>Further Reading:</strong></p>
<p><a title="w3 web storage recommendations" href="http://www.development-cycle.com/2013/01/you-will-now-access-javascriptrecaptcha-reload/" target="_blank">W3 web storage recommendations</a></p>
<p><a title="Fill Disk Local Storage" href="http://feross.org/fill-disk/" target="_blank">Information regarding the Fill Disk POC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/03/filling-device-storage-with-html5-localstorage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding Up Google SDK Manager Downloads</title>
		<link>http://www.development-cycle.com/2013/01/speeding-up-google-sdk-manager-downloads/</link>
		<comments>http://www.development-cycle.com/2013/01/speeding-up-google-sdk-manager-downloads/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 00:37:52 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile Development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=782</guid>
		<description><![CDATA[I have been doing some work developing Android applications with Phonegap over the last few weeks. Getting the Eclipse and ADT is always a breeze. Downloading the required Android SDK libraries using SDK manager is always a pain though the speeds seem to be terrible, with the required time to get a new set of [...]]]></description>
				<content:encoded><![CDATA[<p>I have been doing some work developing Android applications with Phonegap over the last few weeks. Getting the Eclipse and ADT is always a breeze. Downloading the required Android SDK libraries using SDK manager is always a pain though the speeds seem to be terrible, with the required time to get a new set of libraries often being over a couple of hours.</p>
<p>After much pain and suffering i learn&#8217;t it doesnt have to be this way though!</p>
<p><span id="more-782"></span></p>
<p>To fix, click on the tools menu and select &#8220;Options&#8221; from the drop down.</p>
<p><img class="aligncenter size-full wp-image-783" alt="Select tools -&gt; options" src="http://www.development-cycle.com/wp-content/uploads/2013/01/2.png" width="500" height="313" /></p>
<p>Then select the clickbox labelled &#8220;Force https://&#8230; sources to be fetched using http://&#8230;</p>
<p><img class="aligncenter size-full wp-image-785" alt="Change settings" src="http://www.development-cycle.com/wp-content/uploads/2013/01/3.png" width="500" height="317" /></p>
<p>If a download is already in progress cancel it, close the SDK manager and then reopen and start the download again. You should now experience alot faster download speeds, in my case I saw the speed increase from ~50kb/s to around 1000kb/s.</p>
<p><img class="aligncenter size-full wp-image-786" alt="Improved Speed" src="http://www.development-cycle.com/wp-content/uploads/2013/01/1.png" width="500" height="308" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/01/speeding-up-google-sdk-manager-downloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You will now access javascript:Recaptcha.reload();</title>
		<link>http://www.development-cycle.com/2013/01/you-will-now-access-javascriptrecaptcha-reload/</link>
		<comments>http://www.development-cycle.com/2013/01/you-will-now-access-javascriptrecaptcha-reload/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 01:29:12 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=774</guid>
		<description><![CDATA[I was looking at a Whitehouse petition earlier today asking that Patent trolls be made to pay all costs associated with their lawsuits if they lose when I can across the gem below. Although I do appreciate the site keeping me in the loop on what its about to access]]></description>
				<content:encoded><![CDATA[<p>I was looking at a Whitehouse petition earlier today asking that <a href="https://petitions.whitehouse.gov/petition/make-patent-trolls-pay-all-costs-associated-their-frivolous-lawsuits-if-they-lose/gWPpVYMt" title="Petition to make patent trolls pay" target="_blank">Patent trolls be made to pay all costs associated with their lawsuits if they lose</a> when I can across the gem below. </p>
<p>Although I do appreciate the site keeping me in the loop on what its about to access <img src='http://www.development-cycle.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><img src="http://www.development-cycle.com/wp-content/uploads/2013/01/whitehouse.png" alt="Whitehouse Petition Error" width="659" height="458" class="aligncenter size-full wp-image-776" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/01/you-will-now-access-javascriptrecaptcha-reload/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version 0.96 of S3 Video for WordPress Released</title>
		<link>http://www.development-cycle.com/2013/01/version-0-96-of-s3-video-for-wordpress-released/</link>
		<comments>http://www.development-cycle.com/2013/01/version-0-96-of-s3-video-for-wordpress-released/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 05:44:22 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[S3 Video]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=766</guid>
		<description><![CDATA[The latest version of my popular S3 Video plugin has been released to the WordPress plugin repository. After many requests the 0.96 release now allows a user to set a &#8220;still&#8221; image as a title or splash page for their video. A number of bug fixes have also been fixed in the latest release, the [...]]]></description>
				<content:encoded><![CDATA[<p>The latest version of my popular S3 Video plugin has been released to the WordPress plugin repository.</p>
<p>After many requests the 0.96 release now allows a user to set a &#8220;still&#8221; image as a title or splash page for their video. A number of bug fixes have also been fixed in the latest release, the two major ones being:</p>
<ul>
<li>Prefill handling of the &#8220;videos per page&#8221; setting on the plugin settings page.</li>
<li>Videos no longer float above text they are embedded below within a page or post.</li>
</ul>
<p>The bundled copy of Flowplayer with the plugin has also been updated to version 3.2.15.</p>
<p><strong>Plugin background:</strong></p>
<p>The S3 Video for WordPress plugin allows a user to upload video files to their Amazon S3 account via WordPress and embed the videos using Flowplayer or VideoJS directly into pages and posts. For personal and commercial videos this provides lost cost, pay as you go model for video hosting.</p>
<p>More information on the plugin can be found at either the <a href="https://github.com/anthony-mills/s3-video/" target="_blank" title="S3 Video for WordPress on github">plugin&#8217;s github page</a> or the <a title="S3 Video - WordPress Plugin Repository" href="http://wordpress.org/extend/plugins/s3-video/">WordPress plugin repository</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2013/01/version-0-96-of-s3-video-for-wordpress-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Empty Directories In Git</title>
		<link>http://www.development-cycle.com/2012/12/empty-directories-in-git/</link>
		<comments>http://www.development-cycle.com/2012/12/empty-directories-in-git/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 05:29:51 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=761</guid>
		<description><![CDATA[Occasionally when working on a code base the application at hand requires a directory for the storage of log files, uploads etc. You often like to keep the directory itself in the repository but you don&#8217;t want any of its contents that have a temporary lifespan making their way into the project git repository. Which [...]]]></description>
				<content:encoded><![CDATA[<p><img class="size-full wp-image-762 alignleft" alt="Git Logo" src="http://www.development-cycle.com/wp-content/uploads/2012/12/git_logo.png" width="220" height="100" />Occasionally when working on a code base the application at hand requires a directory for the storage of log files, uploads etc. You often like to keep the directory itself in the repository but you don&#8217;t want any of its contents that have a temporary lifespan making their way into the project git repository.</p>
<p>Which causes a dilemma git will not keep directories with no files inside them within your repository. But leaving the directory out of the repository normally causes its own set of issues. For example if another developer clones the codebase they will most likely be faced with random application errors due to your project missing all of its required directories.</p>
<p><span id="more-761"></span></p>
<p>Documentation can always be created to inform people what directories need to be created and where. But in a lot of situations its possible the supporting documentation may get overlooked or simply ignored. To get around this I will show you how to create an empty directory in a git repository using a bit of trickery with a .gitignore file.</p>
<p>To get started simply create the new directory you would like to create with the project code base. Then create a file inside the directory by the name of .gitignore that contains the following:</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="bash" style="font-family:monospace;"><span class="co0"># Ignore the contents of this directory</span>
<span class="sy0">*</span>
<span class="sy0">!</span>.gitignore</pre></div></div>
<p>This tells git to ignore everything in the directory bar the .gitignore file itself. After the file is added to the repository it will allow you to keep the directory with the rest of the application code but not have to worry about any files it contains being added by accident as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2012/12/empty-directories-in-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Keyboard Shortcuts For Aptana Studio</title>
		<link>http://www.development-cycle.com/2012/12/useful-aptana-keyboard-shortcuts/</link>
		<comments>http://www.development-cycle.com/2012/12/useful-aptana-keyboard-shortcuts/#comments</comments>
		<pubDate>Tue, 04 Dec 2012 01:52:02 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Aptana]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=749</guid>
		<description><![CDATA[The last couple of years I have been using Aptana Studio exclusively as my IDE of choice, after deciding it offered the power of Eclipse in a more user friendly format. I find the standard Aptana theme very easy on the eyes when coding for long amounts of time. Unfortunately though sometimes the colour scheme [...]]]></description>
				<content:encoded><![CDATA[<p>The last couple of years I have been using <a title="Homepage of Aptana Studio" href="http://www.aptana.com/" target="_blank">Aptana Studio</a> exclusively as my IDE of choice, after deciding it offered the power of Eclipse in a more user friendly format. I find the standard Aptana theme very easy on the eyes when coding for long amounts of time. Unfortunately though sometimes the colour scheme can make finding matching brackets a pain.</p>
<p>Luckily though a friend filled me on in the <em>&#8220;Goto matching Bracket&#8221;</em> feature. To find a matching bracket in Aptana Studio or Eclipse simply put your cursor on the line containing the bracket you would like to find the partner for and press <em>CTRL + SHIFT + P</em>. This will open up a little menu box with an option labelled &#8220;Goto matching Bracket&#8221;, selecting this will then magically transport your cursor to the line of its matching bracket.</p>
<p><img class="aligncenter size-full wp-image-753" title="goto matching bracket" src="http://www.development-cycle.com/wp-content/uploads/2012/12/goto_matching_bracket.png" alt="" width="426" height="155" /><br />
<span id="more-749"></span><br />
Wow I thought, what an amazing feature but it also got me thinking if it took me so long to find out that handy feature, what other tricks am I missing that would make me more productive in the IDE? So I got looking for other handy tips to make life easier in Eclipse / Aptana Studio and this is what I got:</p>
<ul>
<li><strong>CTRL + SHIFT + P</strong> &#8211; Find a matching bracket</li>
<li><strong>CTRL + O </strong>- Brings up a window illustrating the outline of a class</li>
<li><strong>CTRL + E</strong> &#8211; Change the editor focus to another file that is already open</li>
<li><strong>CTRL + Space</strong> &#8211; Speed up writing code with code completion</li>
<li><strong>CTRL + D</strong> &#8211; Delete the current line in the editor</li>
<li><strong>CTRL + SHIFT + D</strong> &#8211; Duplicate the current line</li>
<li><strong>CTRL + SHIFT + Del</strong> &#8211; Delete the rest of the content on a line after the cursor</li>
<li><strong>CTRL + SHIFT + R</strong> &#8211; Run / open a resource</li>
<li><strong>CTRL + L</strong> &#8211; Go to line</li>
<li><strong>CTRL + .</strong> &#8211; For those with errors in their code, go to the next line reporting an error</li>
<li><strong>CTRL + ,</strong> &#8211; Go to the previous error line</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2012/12/useful-aptana-keyboard-shortcuts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Executing PHP Code Server Side In .html Files</title>
		<link>http://www.development-cycle.com/2012/11/executing-php-code-server-side-in-html-files/</link>
		<comments>http://www.development-cycle.com/2012/11/executing-php-code-server-side-in-html-files/#comments</comments>
		<pubDate>Mon, 26 Nov 2012 02:35:03 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=735</guid>
		<description><![CDATA[On a recent project we needed to provide a client our contribution to the site code base as static .html files. To make the development process easier though a number of the developers wanted to include some of the global page assets such as the header and footer using PHP includes in their development environments. [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-739" title="apache_logo" src="http://www.development-cycle.com/wp-content/uploads/2012/11/apache_logo.png" alt="" width="200" height="178" />On a recent project we needed to provide a client our contribution to the site code base as static .html files. To make the development process easier though a number of the developers wanted to include some of the global page assets such as the header and footer using PHP includes in their development environments. This of course normally does not work as the server never passes the page content to the PHP engine to process as it doesn&#8217;t have a .php or .phtml extension.</p>
<p><span id="more-735"></span></p>
<p>Luckily its pretty easy to change the way Apache handles the .html files within a project with a simple one line .htaccess rule. First thing to check that the Apache virtual host definition for your site allows overrides from a .htaccess file. For example in the virtual host file for a site that looks like:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="apache" style="font-family:monospace;">&lt;<span class="kw3">Directory</span> /home/sites/testsite.com/www/&gt;
	<span class="kw1">Options</span> <span class="kw2">Indexes</span> <span class="kw2">FollowSymLinks</span> MultiViews
	<span class="kw1">AllowOverride</span> <span class="kw2">None</span>
	<span class="kw1">Order</span> <span class="kw1">allow</span>,<span class="kw1">deny</span>
	<span class="kw1">allow</span> from <span class="kw2">all</span>
&lt;/<span class="kw3">Directory</span>&gt;</pre></div></div><br />
The AllowOverride directive would have to change to:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.development-cycle.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="apache" style="font-family:monospace;">&lt;<span class="kw3">Directory</span> /home/sites/testsite.com/www/&gt;
	<span class="kw1">Options</span> <span class="kw2">Indexes</span> <span class="kw2">FollowSymLinks</span> MultiViews
	<span class="kw1">AllowOverride</span> <span class="kw2">All</span>
	<span class="kw1">Order</span> <span class="kw1">allow</span>,<span class="kw1">deny</span>
	<span class="kw1">allow</span> from <span class="kw2">all</span>
&lt;/<span class="kw3">Directory</span>&gt;</pre></div></div>
<p>If you do not want to allow set AllowOveride to &#8220;All&#8221;, it must be set to &#8220;FileInfo&#8221; at a minimum for the AddType directive to work in the .htaccess file. Be sure to restart the web server after making any changes to the Apache configuration files to make the changes active.</p>
<p>Now you must create a .htaccess file in the root of your project if one doesnt already exist. If your are running PHP as an Apache module (around 9/10 server installs) you need to add the line below to your .htaccess file:</p>
<p><em>AddType application/x-httpd-php .html .htm</em></p>
<p>If the server is running PHP as a CGI service you will need to use a line containing the AddHandler directive instead:</p>
<p><em>AddHandler application/x-httpd-php .html .htm</em></p>
<p>Now load .html file within the project that contains PHP code in a browser and the code should execute as normally without the file possessing .php or .phtml extension.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2012/11/executing-php-code-server-side-in-html-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Mobile Web Pages With Opera Developer Tools</title>
		<link>http://www.development-cycle.com/2012/11/debugging-mobile-web-pages-with-opera-developer-tools/</link>
		<comments>http://www.development-cycle.com/2012/11/debugging-mobile-web-pages-with-opera-developer-tools/#comments</comments>
		<pubDate>Thu, 22 Nov 2012 11:29:19 +0000</pubDate>
		<dc:creator>Anthony Mills</dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.development-cycle.com/?p=718</guid>
		<description><![CDATA[If experience has taught me anything its that debugging mobile pages can be a massive pain. Replicating page display issues without a device on hand can prove problematic, and something as simply as testing a number of URL&#8217;s can become very time consuming using a touch screen keyboard to enter each location. Opera Mobile Emulator [...]]]></description>
				<content:encoded><![CDATA[<p>If experience has taught me anything its that debugging mobile pages can be a massive pain. Replicating page display issues without a device on hand can prove problematic, and something as simply as testing a number of URL&#8217;s can become very time consuming using a touch screen keyboard to enter each location. </p>
<p>Opera Mobile Emulator can help ease some of the burden though, available for Mac, Windows and Linux it allows a developer to simulate a variety of mobile devices directly from their desktop machine. To try it out first head to <a href="http://www.opera.com/developer/tools/mobile/" title="Opera Mobile Emulator">http://www.opera.com/developer/tools/mobile/</a> download and then install the appropriate version of the mobile emulator for your platform. The basic use of the emulator is very straight forward simply open it up after installation and you will be presented with a pre-set list of devices the emulator can simulate. If none of the devices fit your requirements you are also able to enter the specific details for a custom virtual device. Launching a device gives you a fully functional mobile instance of Opera to open and test your projects without having to worry about hardware.</p>
<p><span id="more-718"></span><br />
<img src="http://www.development-cycle.com/wp-content/uploads/2012/11/0.png" alt="" title="Available devices to simulate" width="400" height="233" class="aligncenter size-full wp-image-723" /></p>
<p>To make life easier you can also provide arguments when launching a virtual device, some of the useful arguments that can be used are:</p>
<ul>
<li>-url Open a URL on startup, very handy to go straight to the page you are working on</li>
<li>-tabletui: Use the tablet UI</li>
<li>-ppi Define the pixel density</li>
<li>-notouch Disables the simulated touch environment, forcing navigation</li>
</ul>
<p><strong>Setting up Opera mobile emulator with Opera Dragonfly for debugging.<br />
</strong></p>
<p>Being able to see your pages rendered in a simulated environment is useful, but most developers probably long for more. One thing that makes debugging issues in a normal desktop browser easier though is tools having access to tools like Firebug or the web developer tool bar to help with the task. In a mobile browser these tools are not available and a developer cannot even view the source code normally for a page if the need arises. Fortunately the Opera Mobile Emulator can be used in conjunction with Opera Dragonfly a built in debugging feature of their desktop browser to make this task easier.</p>
<p>To use the two in conjunction you will first have to download and install the main Opera browser from <a href="http://www.opera.com/download/" title="Download Opera Browser">http://www.opera.com/download/</a>.</p>
<p>Open Opera, accept the EULA, then press SHIFT + CTL + I keys at the same time and Opera Dragon will open up. For those familiar with Firebug at a glance it looks very similar. </p>
<p>To enable remote debugging click the button labelled &#8220;remote debug configuration&#8221; (its the fourth button from the right up the top of Opera Dragon.<br />
<img src="http://www.development-cycle.com/wp-content/uploads/2012/11/1.png" alt="" title="Listening for connections" width="717" height="399" class="aligncenter size-full wp-image-721" /><br />
Simply press apply to enable debugging on the default port and the window will report it is now listening for incoming connections on port 7001.<br />
<img src="http://www.development-cycle.com/wp-content/uploads/2012/11/2.png" alt="" title="Waiting for connections" width="400" height="153" class="aligncenter size-full wp-image-726" /><br />
Now open up the Opera mobile emulator, select the device you would like to simulate and then press launch to open the browser environment.</p>
<p>In the address bar now enter &#8220;opera:debug&#8221; and hit enter. If you are running the main instance of Opera on the same machine as the mobile emulator you can use   the defaults on the resulting page otherwise enter the IP address of the machine running Opera Dragonfly and press the connect button.<br />
<img src="http://www.development-cycle.com/wp-content/uploads/2012/11/4.png" alt="" title="opera:debug" width="400" height="678" class="aligncenter size-full wp-image-728" /><br />
With any luck the window should now report that its connect to the Dragonfly panel. Now using the mobile emulator browse to the location you would like to debug,   now look in dragon fly and you should be able to see the various elements from the page.</p>
<p>If you have multiple tabs on in the mobile emulator you may see the wrong page being displayed in the debugger. To focus on the correct tab click the button to the right of the &#8220;Remote Debugging Configuration&#8221; button you clicked earlier. This will display the tabs you have open in mobile emulator and allow you to change focus to the desired window.<br />
<img src="http://www.development-cycle.com/wp-content/uploads/2012/11/8.png" alt="" title="Tab Selection For Debugging" width="400" height="356" class="aligncenter size-full wp-image-729" /><br />
You can now debug and mobile pages you are having issues with remotely in the Opera Dragonfly window&#8230;&#8230; Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.development-cycle.com/2012/11/debugging-mobile-web-pages-with-opera-developer-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
