<?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>Hypn.za.net &#187; PHP</title>
	<atom:link href="http://www.hypn.za.net/blog/category/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hypn.za.net/blog</link>
	<description>Games, programming, and general geekyness =)</description>
	<lastBuildDate>Fri, 27 Jan 2012 09:37:46 +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>When I hate being a coder&#8230; #2</title>
		<link>http://www.hypn.za.net/blog/2010/11/11/when-i-hate-being-a-coder-2/</link>
		<comments>http://www.hypn.za.net/blog/2010/11/11/when-i-hate-being-a-coder-2/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 12:53:35 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=413</guid>
		<description><![CDATA[I just found this gem, in some of our billing code: $ci = $this-&#62;paymentMethod; $cc['CC_CardType'] = $ci['CC_CardType']; $cc['CC_Number'] = $ci['CC_Number']; $cc['CC_ExpMonth'] = $ci['CC_ExpMonth']; $cc['CC_ExpYear'] = $ci['CC_ExpYear']; $cc['CC_Name'] = $ci['CC_Name']; $cc['CC_Street'] = $ci['CC_Street']; $cc['CC_City'] = $ci['CC_City']; $cc['CC_State'] = $ci['CC_State']; $cc['CC_Country'] = $ci['CC_Country']; $cc['CC_Zip'] = $ci['CC_Zip']; $p-&#62;loadCreditCardPayment($cc, $total, 0); First it copies A ($this-&#62;paymentMethod) to B ($ci), [...]]]></description>
			<content:encoded><![CDATA[<p>I just found this gem, in some of our billing code:</p>
<blockquote><p>$ci = $this-&gt;paymentMethod;</p>
<p>$cc['CC_CardType'] = $ci['CC_CardType'];<br />
$cc['CC_Number'] = $ci['CC_Number'];<br />
$cc['CC_ExpMonth'] = $ci['CC_ExpMonth'];<br />
$cc['CC_ExpYear'] = $ci['CC_ExpYear'];<br />
$cc['CC_Name'] = $ci['CC_Name'];<br />
$cc['CC_Street'] = $ci['CC_Street'];<br />
$cc['CC_City'] = $ci['CC_City'];<br />
$cc['CC_State'] = $ci['CC_State'];<br />
$cc['CC_Country'] = $ci['CC_Country'];<br />
$cc['CC_Zip'] = $ci['CC_Zip'];</p>
<p>$p-&gt;loadCreditCardPayment($cc, $total, 0);</p></blockquote>
<p>First it copies A (<em>$this-&gt;paymentMethod</em>) to B (<em>$ci</em>), then copies each value of B in to C (<em>$cc</em>), and then passes C to the function. That&#8217;s right, 3 copies of the same data, and 14 lines of code. One could also have just passed A to the function, as so:</p>
<blockquote><p>$p-&gt;loadCreditCardPayment($this-&gt;paymentMethod, $total, 0);</p></blockquote>
<p>It&#8217;s kinda like pouring a drink that&#8217;s already in glass in to another glass, then using a spoon to move the liquid in to a different glass, then drinking from that last glass&#8230; why not just drink from the glass it was originally in? o_O</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2010/11/11/when-i-hate-being-a-coder-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When I hate being a coder&#8230;</title>
		<link>http://www.hypn.za.net/blog/2010/09/03/when-i-hate-being-a-coder/</link>
		<comments>http://www.hypn.za.net/blog/2010/09/03/when-i-hate-being-a-coder/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 11:30:44 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=392</guid>
		<description><![CDATA[This is how NOT to comment your code: #addCreditCard function addCreditCard(){ &#8230; code removed &#8230; //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- #addBankAccount function addBankAccount(){ &#8230; code removed &#8230; //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; #deleteCreditCard() function deleteCreditCard(){ &#8230; code removed &#8230; //&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; #deleteBankAccount() function deleteBankAccount(){ &#8230; code removed &#8230; Now I totally understand that for doc-generating programs, and certain IDEs, you&#8217;re meant to put comments [...]]]></description>
			<content:encoded><![CDATA[<p>This is how NOT to comment your code:</p>
<blockquote><p><em>#addCreditCard<br />
function addCreditCard(){<br />
&#8230; code removed &#8230;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#addBankAccount<br />
function addBankAccount(){<br />
&#8230; code removed &#8230;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#deleteCreditCard()<br />
function deleteCreditCard(){<br />
&#8230; code removed &#8230;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#deleteBankAccount()<br />
function deleteBankAccount(){<br />
&#8230; code removed &#8230;</em></p></blockquote>
<p>Now I totally understand that for doc-generating programs, and certain IDEs, you&#8217;re meant to put comments above your functions describing them and the parameters use&#8230; but who does this (above)? Are you really so stupid that you need to put the function&#8217;s name in a comment above&#8230; the function&#8217;s name?</p>
<p>You, sir, should not be coding.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2010/09/03/when-i-hate-being-a-coder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB Webserver 8.0 is out!</title>
		<link>http://www.hypn.za.net/blog/2010/07/15/usb-webserver-8-0-is-out/</link>
		<comments>http://www.hypn.za.net/blog/2010/07/15/usb-webserver-8-0-is-out/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 10:06:27 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=356</guid>
		<description><![CDATA[I&#8217;ve just gotten word from the creators that USB Webserver 8 is out &#8211; long time readers might remember that I released an unofficial hacked up version a little while ago, you should definitely use this official version instead. This release contains: Php 5.2.13 Apache 2.2.15 PhpMyAdmin 3.3.1-rc1 MySQL 5.1.44]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hypn.za.net/blog/wp-content/uploads/2010/07/USB-Webserver-8.png"><br />
</a>I&#8217;ve just gotten word from the creators that <a href="http://www.usbwebserver.net/" target="_blank">USB Webserver 8</a> is out &#8211; long time readers might remember that I released an unofficial hacked up version a little while ago, you should definitely use this official version instead.</p>
<p style="text-align: center;"><img title="USB Webserver 8" src="/images/usbwebserver8.png" alt="USB Webserver 8" /></a></p>
<p>This release contains:</p>
<ul>
<li>Php 5.2.13</li>
<li>Apache 2.2.15</li>
<li>PhpMyAdmin 3.3.1-rc1</li>
<li>MySQL 5.1.44</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2010/07/15/usb-webserver-8-0-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB Webserver 8.0 (unofficial)</title>
		<link>http://www.hypn.za.net/blog/2009/05/17/usb-webserver-80-unofficial/</link>
		<comments>http://www.hypn.za.net/blog/2009/05/17/usb-webserver-80-unofficial/#comments</comments>
		<pubDate>Sun, 17 May 2009 09:14:55 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=228</guid>
		<description><![CDATA[UPDATE (15 July 2010): An &#8220;official&#8221; version of USB Webserver 8 has been released, please use this instead of my &#8220;unofficial&#8221; version. You can download it from http://www.usbwebserver.net/ This is an unofficial updated version of USB Webserver. The original USB Webserver was created by http://www.usbwebserver.nl &#8211; but their site is currently down, and they haven&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE (15 July 2010):</strong> An &#8220;official&#8221; version of USB Webserver 8 has been released, please use this instead of my &#8220;unofficial&#8221; version. You can download it from <a href="http://www.usbwebserver.net/" target="_blank">http://www.usbwebserver.net/</a></p>
<p>This is an unofficial updated version of USB Webserver. The original USB Webserver was created by <a title="USB Webserver" href="http://www.usbwebserver.nl" target="_blank">http://www.usbwebserver.nl</a> &#8211; but their site is currently down, and they haven&#8217;t released an update for a while.</p>
<p>This version contains:</p>
<p>Apache: 2.2.11<br />
PHP: 5.2.10-dev (with GD and cURL)<br />
MySQL: 5.1.30-community (with InnoDB)</p>
<p>It defaults to &#8220;English&#8221; (the original was &#8220;Dutch&#8221;), and you may need to change the ports if you have been using USB Webserver previously.</p>
<p><strong>Download</strong>: &#8220;<a href="http://hypn.za.net/downloads/USB%20Webserver%208.0%20(unofficial).zip">USB Webserver 8.0 (unofficial).zip</a>&#8221; (17.6mb)</p>
<p>(and yes, I know the main USB Webserver screen still says &#8220;USB Webserver 7.0&#8243; &#8211; ignore that :P)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2009/05/17/usb-webserver-80-unofficial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>memcache on PHP 5.2.*</title>
		<link>http://www.hypn.za.net/blog/2009/04/07/memcache-on-php-52/</link>
		<comments>http://www.hypn.za.net/blog/2009/04/07/memcache-on-php-52/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 12:24:56 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=218</guid>
		<description><![CDATA[I decided I wanted to start using memcached because it&#8217;s really awesome, but really struggled to get it working in Windows on PHP 5.2.3 because I couldn&#8217;t find the stupid &#8220;php_memcache.dll&#8221; file I needed (at the time of writing this, Pecl4Win is down&#8230; which happens to be where the official PHP documentation tells you to [...]]]></description>
			<content:encoded><![CDATA[<p>I decided I wanted to start using <a href="http://www.danga.com/memcached/">memcached</a> because it&#8217;s really awesome, but really struggled to get it working in Windows on PHP 5.2.3 because I couldn&#8217;t find the stupid &#8220;php_memcache.dll&#8221; file I needed (at the time of writing this, Pecl4Win is down&#8230; which happens to be where the official PHP documentation tells you to get it from &#8211; great).</p>
<p>Luckily I came across <a href="http://pureform.wordpress.com/2008/01/10/installing-memcache-on-windows-for-php/">this blog post</a>, which not only tells you how to to install the extension (adding 1 line to your &#8220;php.ini&#8221; file) but also linked to a PHP 5.2.* version of the it. I decided to mirror it, for anyone else trying to find it:</p>
<p style="text-align: center;"><strong><a href="/downloads/php5.2/php_memcache.dll">php_memcache.dll</a></strong> (49kb)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2009/04/07/memcache-on-php-52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-SciTE</title>
		<link>http://www.hypn.za.net/blog/2008/10/05/php-scite/</link>
		<comments>http://www.hypn.za.net/blog/2008/10/05/php-scite/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 20:38:10 +0000</pubDate>
		<dc:creator>Hypn</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hypn.za.net/blog/?p=157</guid>
		<description><![CDATA[As a PHP developer I&#8217;ve tried many different IDEs but have always ended going back to SciTE. I started using a version with modifications by Bruce Dodson, but got frustrated with it not listing PHP files in the default &#8220;File Open&#8221; window, and not recognizing PHP5 files as PHP files, so I got to tinkering. [...]]]></description>
			<content:encoded><![CDATA[<p>As a PHP developer I&#8217;ve tried many different IDEs but have always ended going back to <a href="http://www.scintilla.org/SciTE.html" target="_blank">SciTE</a>. I started using a version with modifications by <a href="http://gisdeveloper.tripod.com/scite.html" target="_blank">Bruce Dodson</a>, but got frustrated with it not listing PHP files in the default &#8220;File Open&#8221; window, and not recognizing PHP5 files as PHP files, so I got to tinkering.</p>
<p>I changed the font and colours (for PHP files anyway), removed the other languages, enabled the auto-complete dropdown, changed the menus, included the PHP binary to check files for syntax errors, and included <a href="http://www.sourceforge.net/projects/phpstylist" target="_blank">phpStylist</a> to beautify source code. I also made a new icon, and added the latest &#8220;php.api&#8221;, and made F1 (help) open the PHP manual (included).<br />
<span id="more-157"></span><br />
I made this package for my own personal use, and possibly that of friends, and I offer NO (as in ZERO) support for it. I will also not be held responsible for any damages caused &#8211; you use this at your own risk. Please do not contact the authors of SciTE regarding bugs or problems as I have made several modifications to the compiled executable that may result in all sorts of bugs &#8211; which they aren&#8217;t responsible for.</p>
<p>That said, I hope you will find this packge useful. Once you&#8217;ve opened a PHP file (with &#8220;PHP-SciTE.exe&#8221;) press F5 to check for syntax errors, F7 to run the PHP script currently open, and CTRL+F7 to tidy your source code.</p>
<p>Please realize that your code will be changed to how I like my code formatted which might frustrate you&#8230; the settings passed to phpStylist are in &#8220;php_tidy.bat&#8221; if you want to change them.</p>
<p>I really don&#8217;t know SciTE that well, and most of what I&#8217;ve done has just been lucky guessing, so I probably wont be able to help you with questions but if you want to get hold of me you can e-mail me at: php-scite[at]hypn.za.net</p>
<p>Download: <a href="/downloads/PHP-SciTE 1.7.6.zip">PHP-SciTE 1.7.6.zip</a> (8.85mb)</p>
<p>UPDATE: first bug :( the &#8220;Check Syntax&#8221; menu item (under &#8220;Tools&#8221;) says the hotkey is CTRL+F5, but it&#8217;s actually just F5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hypn.za.net/blog/2008/10/05/php-scite/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

