<?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>TLF Blog &#187; Programming</title>
	<atom:link href="http://thelinuxfix.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelinuxfix.com/blog</link>
	<description>Hosting, Unix, and everything in between.</description>
	<lastBuildDate>Wed, 06 Feb 2013 18:05:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Understanding IonCube</title>
		<link>http://thelinuxfix.com/blog/2012/01/10/understanding-ioncube/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=understanding-ioncube</link>
		<comments>http://thelinuxfix.com/blog/2012/01/10/understanding-ioncube/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 20:52:55 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TLF Blog]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[ioncube]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://thelinuxfix.com/blog/?p=136</guid>
		<description><![CDATA[PHP has been an Internet mainstay for well over a decade.   Originally created to make boring, static home pages more dynamic and interesting (factoid: PHP originally stood for Personal Home Pages!) it is now nearly ubiquitous in deployment, installed on over one million web servers all over the planet. Much of PHP&#8217;s success can [...]]]></description>
			<content:encoded><![CDATA[<p><a title="PHP Home" href="http://www.php.net/" target="_blank">PHP</a> has been an Internet mainstay for well over a decade.   Originally created to make boring, static home pages more dynamic and interesting (factoid: PHP originally stood for Personal Home Pages!) it is now nearly ubiquitous in deployment, installed on over one million web servers all over the planet.</p>
<p>Much of PHP&#8217;s success can be attributed to it being free and open, able to run on nearly every operating system, and being easy to use and learn.   Yet the same things that have made it so successful in the open source community have historically hindered its commercial success.   But why?</p>
<p>Quite simply PHP is a scripted language.   Unlike C programs which need pre-compilation to run, PHP is compiled and executed on the fly by the PHP engine.  Perl, JavaScript, and Shell script all execute in a similar manner.  This makes PHP very flexible and friendly to open source and hobbyist developers, but it essentially <em>requires</em> you to &#8220;give away&#8221; your source code in order to distribute your program.</p>
<p>Of course commercial developers attempting to make a profit on their work won&#8217;t  want to give away their code, not if they expect to make money! But the PHP market was huge and lucrative, so unsurprisingly a company stepped in to offer a solution.  That solution is IonCube, and here’s how it works.</p>
<p>First, the commercial PHP developer will write their application.   When it&#8217;s finished, the developer will use the IonCube program to encode the raw, human-readable PHP source code in a proprietary binary format.  This protects the underlying source code from prying eyes by turning it into a jumble of unreadable goobleygook.</p>
<p>Next,  the application is purchased by an end user.  After the purchase, the application developer provides the customer with a special key which is used to &#8220;unlock&#8221; the encoded source.</p>
<p>Finally, the customer installs the IonCube Loader on their web server, which acts as a on-the-fly decoder for the coded application.    At no time is the user ever able to view the PHP source code:  all the decoding happens inside the web server via the IonCube loader.   This keeps the application code a secret for the developer, as well as allowing fine control over the licensing of their application via the unlock key.</p>
<p>Though IonCube had a rocky start at its debut in 2002 (thanks somewhat to vocal opposition by strong open source proponents), it has slowly become the de-facto standard for distributing non-free PHP applications.   Though not all web hosts support it, The Linux Fix offers the <a title="TLF Hosting Features" href="http://tlfhosting.com/hosting-features" target="_blank">IonCube Loader</a> with every <a href="http://tlfhosting.com/hosting">web hosting plan</a> we provide.  We hope that it gives you the freedom of using whatever PHP application you choose, without much fuss!</p>
]]></content:encoded>
			<wfw:commentRss>http://thelinuxfix.com/blog/2012/01/10/understanding-ioncube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Living Through Proper Programming</title>
		<link>http://thelinuxfix.com/blog/2011/12/01/better-living-through-proper-programming/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=better-living-through-proper-programming</link>
		<comments>http://thelinuxfix.com/blog/2011/12/01/better-living-through-proper-programming/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 15:56:20 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[error traps]]></category>

		<guid isPermaLink="false">http://thelinuxfix.com/blog/?p=131</guid>
		<description><![CDATA[As I&#8217;m sure is true with many of you reading this, I&#8217;m a busy guy.   My days seem shorter than they used to be, though I&#8217;m pretty sure the Earth is spinning about the same speed it was ten years ago! Nevertheless, when it comes down to scripting and programming, I try to take [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;m sure is true with many of you reading this, I&#8217;m a busy guy.   My days seem shorter than they used to be, though I&#8217;m pretty sure the Earth is spinning about the same speed it was ten years ago!</p>
<p>Nevertheless, when it comes down to scripting and programming, I try to take my time.   When I&#8217;m in the process of writing code, especially when that particular bit of code may involve external processing (say reading from a URI), I like to think out all the possible ways it could go wrong.   Not only is this good programming practice for debugging purposes, but writing it in such a way allows you to present very relevant and accurate error messages to your users.</p>
<p>Now, let me explain why this is important.</p>
<p>Earlier this week I was offering help to my housing overlords with a computer problem they happen to use for their point-of-sale system.   Whenever they tried to print a receipt on their printer, an error message would pop up stating &#8220;Insufficient disk space to print&#8221;.</p>
<p>The computer had 300GB of free disk space.</p>
<p>To make a long story short, the program lied.   The problem was that &#8220;C:\windows\temp&#8221; had the read-only attribute turned on.   The disk wasn&#8217;t full at all, but since the printer driver program couldn&#8217;t write to that path, it <em>assumed</em> the drive was full.  We all know what &#8220;assume&#8221;-ing makes us&#8230;</p>
<p>One silly coding choice by a programmer burned several hours of my life away.   If the programmer had simply chosen to test a few conditions before attempting to write the file, namely:</p>
<ul>
<li>Does the directory exist?</li>
<li>What are the modes on the directory?</li>
<li>Is there a file named the same as I&#8217;m about to write?</li>
<li>&#8230; and so on</li>
</ul>
<div>A more relevant message could have been displayed to me, and I could&#8217;ve solved the problem much more quickly.</div>
<div>So programmers, I beg of you:  When handing operations that lie outside your code (network calls, file access, etc) be sure to remember that ideal conditions may not always exist.   The network could be slow, or intermittent, the directory you&#8217;re writing to may not exist, and so on.   Instead of letting your users guess why your program isn&#8217;t working&#8211;just test these things in your code and tell them!</div>
]]></content:encoded>
			<wfw:commentRss>http://thelinuxfix.com/blog/2011/12/01/better-living-through-proper-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
