<?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>Geekinator.com &#187; php</title>
	<atom:link href="http://www.geekinator.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekinator.com</link>
	<description></description>
	<lastBuildDate>Sat, 29 Oct 2011 14:49:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Want to speed up your coding? Give a framework a try!</title>
		<link>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/</link>
		<comments>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 16:28:04 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.geekinator.com/?p=105</guid>
		<description><![CDATA[I&#8217;ve been working with PHP for about 10 years now, and the one problem I&#8217;ve always had was keeping my code organized and how to reuse my code efficiently. Well, a couple of years ago, I ran across some information about using frameworks to help speed up the coding process. I&#8217;m always a big fan [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with PHP for about 10 years now, and the one problem I&#8217;ve always had was keeping my code organized and how to reuse my code efficiently. Well, a couple of years ago, I ran across some information about using frameworks to help speed up the coding process. I&#8217;m always a big fan of making things easier, even if it&#8217;s &#8220;not the way most people would do it&#8221; or &#8220;not the way a professional would do it&#8221;&#8230;forget that, I say whatever gets the job done is what wins!</p>
<p>There are many frameworks to choose from for pretty much any scripting or programming language. Because I mainly code my web apps in PHP, I decided to first try <a href="http://www.codeigniter.com" target="_blank">CodeIgniter</a> because it seemed simple enough. Well, it turned out to be far too simple for me, because I was looking for something that took care of a lot of the heavy lifting for me. I don&#8217;t like reinventing the wheel&#8230;if it&#8217;s already done and it works, why not use it. I&#8217;m not going to go into all the details about the features CodeIgniter offers, but their website has very good documentation if you want to learn about it. Once I tried CodeIgniter and found it to be too limited for my tastes (I&#8217;m not saying it&#8217;s not a good framework, but I would recommend it to someone who really wants to code most of the logic themselves), I decided to give another framework, named <a href="http://www.cakephp.org" target="_blank">CakePHP</a>, a try.</p>
<p>CakePHP turned out to be a huge time saver in most areas for me. Not only does it help me keep my code well organized, because of the <a href="http://en.wikipedia.org/wiki/Model%E2%80%93View%E2%80%93Controller" target="_blank">MVC</a> (model, view, controller) structure, but there are tons of functions included with the release that help with the most common and some advanced features. I&#8217;m still learning the ins and outs of designing an app using the MVC approach, because it&#8217;s very alien to me since I&#8217;ve always been a pretty unorganized coder, but I&#8217;m getting there. With time, I think it may force me to become a better programmer overall.</p>
<p>So, if you&#8217;re like me and are having trouble keeping your code organized or just want something to make building dynamic web apps easier, give a framework a try&#8230;you may just be surprised at how much easier it is to develop your apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2010/08/24/want-to-speed-up-your-coding-give-a-framework-a-try/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed up your PHP pages with Gzip!</title>
		<link>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/</link>
		<comments>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 00:51:52 +0000</pubDate>
		<dc:creator>geekinator</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://geekinator.com/?p=13</guid>
		<description><![CDATA[I can&#8217;t believe I haven&#8217;t learned about this little trick until recently, but I&#8217;m sure glad I learned it. A lot of you may already know this, but there&#8217;s a simple little tag you can add to the top of your PHP pages that will speed up the transfer of your site significantly, and on [...]]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t believe I haven&#8217;t learned about this little trick until recently, but I&#8217;m sure glad I learned it. A lot of you may already know this, but there&#8217;s a simple little tag you can add to the top of your PHP pages that will speed up the transfer of your site significantly, and on the fly. Don&#8217;t ask me how it works exactly, but I can tell you that it uses gzip compression (from what I have read) to automatically compress the output of your pages before it&#8217;s sent to the visitors&#8217; browser.</p>
<p>All you have to do is add the following line to the top of any php page you want to compress: ob_start(&#8220;ob_gzhandler&#8221;)</p>
<p>For example, if your page looks like this:</p>
<p>&lt;?php</p>
<p><!--p<--></p>
<p>echo &#8220;This is my page&#8221;;</p>
<p>?&gt;</p>
<p>Your finished, compressed, file would look like:</p>
<p>&lt;?php</p>
<p><!--p<--></p>
<p>ob_start(&#8220;ob_gzhandler&#8221;)</p>
<p>echo &#8220;This is my page&#8221;;</p>
<p>?&gt;</p>
<p>I also read somewhere (and if I can find the post again, I&#8217;ll update this post to give that person credit), that you should add an if statement around that line to make sure the visitor&#8217;s browser supports gzip. I&#8217;m not sure if it&#8217;s absolutely necessary these days, but I added it just to be safe. So, the line I add to my files is:</p>
<p>if(!ob_start(&#8220;ob_gzhandler&#8221;)){ ob_start(); }</p>
<p>Now, I&#8217;m not an expert at compression or anything, but it works and that&#8217;s good enough for me until I find out there&#8217;s some sort of problem with doing it that way. By the way, you can test your page to see if the gzip is actually working or not by going to <a href="http://www.whatsmyip.org/http_compression/" target="_blank">http://www.whatsmyip.org/http_compression/</a>. Another thing I should mention is your server has to have the zlib php library installed and active. You can read more about that at <a href="http://php.net/manual/en/book.zlib.php" target="_blank">http://php.net/manual/en/book.zlib.php</a></p>
<p>On most of my large files, I was able to compress the output by as much as 90% in some cases. The larger your output is, the higher compression you&#8217;ll achieve. I&#8217;m not sure if this is the &#8220;correct&#8221; way of adding the compression to wordpress, but all I did was add the line to the header.php file in my template. I tested the site and it&#8217;s gzipped!</p>
<p>Of course, there&#8217;s also the added bonus (more likely the reason you&#8217;d want to do this for a really large site) of saving on your bandwidth usage. For really large sites, the cost of bandwith can be pretty large, but I think I like the idea of it speeding up the site for my visitors even more than the bandwith savings.</p>
<p>I hope that helped everyone as much as it helped me. Thanks to the guys over at WhatsMyIp.org for the information.</p>
<p><strong>EDIT: </strong>I didn&#8217;t know this until a few days after posting the php code, but you can also gzip an entire site  using .htaccess (at least the html output of the site anyway). All you have to do is add these 2 lines to your .htaccess file:</p>
<p>php_value output_buffering On<br />
php_value output_handler ob_gzhandler</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekinator.com/2010/02/06/speed-up-your-php-pages-with-gzip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

