<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
>

<channel>
	<title>Compiled Weekly &#187; News</title>
	<atom:link href="http://www.compiledweekly.com/category/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.compiledweekly.com</link>
	<description>Compiled weekly is a weekly podcast for open source developers. Topics include PHP, MySQL, wxWidgets, NSIS and more.</description>
	<lastBuildDate>Thu, 24 Jun 2010 16:01:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<!-- podcast_generator="Blubrry PowerPress/1.0.8" mode="advanced" entry="normal" -->
	<itunes:summary>Compiled weekly is a weekly podcast for open source developers. Topics include PHP, MySQL, wxWidgets, NSIS and more.

Compiled weekly will soon be covering Android SDK. Stay tuned!</itunes:summary>
	<itunes:author>Angelo Mandato</itunes:author>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.compiledweekly.com/wp-content/themes/angelo2/images/itunes_cw.png" />
	<itunes:owner>
		<itunes:name>Angelo Mandato</itunes:name>
		<itunes:email>compiledweekly@gmail.com</itunes:email>
	</itunes:owner>
	<managingEditor>compiledweekly@gmail.com (Angelo Mandato)</managingEditor>
	<copyright>&#xA9; 2006-2008 Compiled Weekly</copyright>
	<itunes:subtitle>Compiled weekly is a weekly podcast for open source developers. Topics include PHP, MySQL, wxWidgets, NSIS and more.</itunes:subtitle>
	<itunes:keywords>programming, php, mysql, wxwidgets, apache, lighttpd, nsis, web design</itunes:keywords>
	<image>
		<title>Compiled Weekly &#187; News</title>
		<url>http://www.compiledweekly.com/wp-content/themes/angelo2/images/rss_cw.png</url>
		<link>http://www.compiledweekly.com/category/news/</link>
	</image>
	<itunes:category text="Education">
		<itunes:category text="Education Technology" />
	</itunes:category>
	<itunes:category text="Technology">
		<itunes:category text="Podcasting" />
		<itunes:category text="Software How-To" />
	</itunes:category>
		<item>
		<title>Converting URL to Local File Path in Batch MySQL INSERT Query Using SUBSTRING_INDEX() and CONCAT()</title>
		<link>http://www.compiledweekly.com/2009/01/05/converting-url-to-local-file-path-in-batch-mysql-insert-query-using-substring_index-and-concat/</link>
		<comments>http://www.compiledweekly.com/2009/01/05/converting-url-to-local-file-path-in-batch-mysql-insert-query-using-substring_index-and-concat/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 21:28:46 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[concat]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[insert from select]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[substring_index]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/?p=114</guid>
		<description><![CDATA[I wanted to quickly take a URL (e.g. http://www.compiledweekly.com/somefolder/somefile.ext) and translate it to the local path (e.g. /home/user/public_html/somefolder/somefile.ext) while inserting multiple records into a new table. My first thought was to select all the records, use PHP to trim off the path, then insert the new record in the new table. There&#8217;s a better answer, [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to quickly take a URL (e.g. http://www.compiledweekly.com/somefolder/somefile.ext) and translate it to the local path (e.g. /home/user/public_html/somefolder/somefile.ext) while inserting multiple records into a new table. My first thought was to select all the records, use PHP to trim off the path, then insert the new record in the new table. There&#8217;s a better answer, use SUBSTRING_INDEX() and CONCAT() with a INSERT INTO table SELECT statement.</p>
<p style="padding-left: 30px;">INSERT INTO new_table<br />
SELECT CONCAT(&#8216;/home/user/public_html/somefolder/&#8217;, SUBSTRING_INDEX(s.url, &#8216;/&#8217;, -1)) AS local_path<br />
FROM source_table AS s<br />
WHERE &#8230;</p>
<p>It does the job with out having to write a single line of PHP code!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2009/01/05/converting-url-to-local-file-path-in-batch-mysql-insert-query-using-substring_index-and-concat/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Publish test</title>
		<link>http://www.compiledweekly.com/2008/11/21/publish-test/</link>
		<comments>http://www.compiledweekly.com/2008/11/21/publish-test/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 22:45:43 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[tag 6]]></category>
		<category><![CDATA[tag 7]]></category>
		<category><![CDATA[tag1]]></category>
		<category><![CDATA[tag2]]></category>
		<category><![CDATA[tag3]]></category>
		<category><![CDATA[tag4]]></category>
		<category><![CDATA[tag5]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/2008/11/21/publish-test/</guid>
		<description><![CDATA[Publish test Download This Episode]]></description>
			<content:encoded><![CDATA[<p>Publish test</p>
<p><a title="Download This Episode" href="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-21-17-45-08.mp3">Download This Episode</a><!--enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-21-17-45-08.mp3" length="36020384" type="audio/mpeg" duration="74:56" --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2008/11/21/publish-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-21-17-45-08.mp3" length="36020384" type="audio/mpeg" />
			<itunes:keywords>tag 6,tag 7,tag1,tag2,tag3,tag4,tag5</itunes:keywords>
		<itunes:subtitle>Publish test - Download This Episode</itunes:subtitle>
		<itunes:summary>Publish test

Download This Episode (http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-21-17-45-08.mp3)</itunes:summary>
		<itunes:author>Angelo Mandato</itunes:author>
		<itunes:explicit>no</itunes:explicit>
	</item>
		<item>
		<title>Compiled Weekly Recording from G1 Android Phone Try 2</title>
		<link>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone-try-2/</link>
		<comments>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone-try-2/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 18:33:47 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[tag1]]></category>
		<category><![CDATA[tag2]]></category>
		<category><![CDATA[tag3]]></category>
		<category><![CDATA[tag7]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone-try-2/</guid>
		<description><![CDATA[This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time! Attempt 2! The first attempt I did not save the mp3 in stereo mode, which meant flash and quicktime among [...]]]></description>
			<content:encoded><![CDATA[<p>This is a recording of Compiled Weekly from the recorder app in the<br />
Google G1 Android phone. It came out pretty well. What do you think? I<br />
may start podcasting this way all the time!</p>
<p>Attempt 2!</p>
<p>The first attempt I did not save the mp3 in stereo mode, which meant flash and quicktime among other players would not be able to play the file correctly. Problem fixed in this version.</p>
<p><a title="Download This Episode" href="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-13-33-44.mp3">Download This Episode</a><!--enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-13-33-44.mp3" length="443938" type="audio/mpeg" duration="" --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone-try-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-13-33-44.mp3" length="443938" type="audio/mpeg" />
			<itunes:keywords>tag1,tag2,tag3,tag7</itunes:keywords>
		<itunes:subtitle>This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time! - Attempt 2! - The first attempt I did not save the mp3 in stereo mode,</itunes:subtitle>
		<itunes:summary>This is a recording of Compiled Weekly from the recorder app in the
Google G1 Android phone. It came out pretty well. What do you think? I
may start podcasting this way all the time!

Attempt 2!

The first attempt I did not save the mp3 in stereo mode, which meant flash and quicktime among other players would not be able to play the file correctly. Problem fixed in this version.

Download This Episode (http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-13-33-44.mp3)</itunes:summary>
		<itunes:author>Angelo Mandato</itunes:author>
		<itunes:explicit>no</itunes:explicit>
	</item>
		<item>
		<title>Compiled Weekly Recording from G1 Android Phone</title>
		<link>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone/</link>
		<comments>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 17:57:09 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[tag1]]></category>
		<category><![CDATA[tag9]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone/</guid>
		<description><![CDATA[This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time! Download This Episode]]></description>
			<content:encoded><![CDATA[<p>This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time!</p>
<p><a title="Download This Episode" href="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-12-57-08.mp3">Download This Episode</a><!--enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-12-57-08.mp3" length="832222" type="audio/mpeg" duration="" --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2008/11/12/compiled-weekly-recording-from-g1-android-phone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-12-57-08.mp3" length="832222" type="audio/mpeg" />
			<itunes:keywords>tag1,tag9</itunes:keywords>
		<itunes:subtitle>This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time! - Download This Episode</itunes:subtitle>
		<itunes:summary>This is a recording of Compiled Weekly from the recorder app in the Google G1 Android phone. It came out pretty well. What do you think? I may start podcasting this way all the time!

Download This Episode (http://media.blubrry.com/compiled_weekly/content.blubrry.com/compiled_weekly/CW-2008-11-12-12-57-08.mp3)</itunes:summary>
		<itunes:author>Angelo Mandato</itunes:author>
		<itunes:explicit>no</itunes:explicit>
	</item>
		<item>
		<title>Sun acquires MySQL</title>
		<link>http://www.compiledweekly.com/2008/01/28/sun-acquires-mysql/</link>
		<comments>http://www.compiledweekly.com/2008/01/28/sun-acquires-mysql/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 22:20:42 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[falcon]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[myisam]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[storage engine]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/2008/01/28/sun-acquires-mysql/</guid>
		<description><![CDATA[If you have not herd, Sun Microsystems is acquiring MySQL. I think this is a great move, especially since Sun has embraced the open source community as strong, if not stronger, than other large companies such as IBM, Yahoo and Google. Article: http://www.mysql.com/news-and-events/sun-to-acquire-mysql.html I think the move is a good one for MySQL. With the [...]]]></description>
			<content:encoded><![CDATA[<p>If you have not herd, Sun Microsystems is acquiring MySQL. I think this is a great move, especially since Sun has embraced the open source community as strong, if not stronger, than other large companies such as IBM, Yahoo and Google.</p>
<p>Article: <a href="http://www.mysql.com/news-and-events/sun-to-acquire-mysql.html" title="Sun to Acquire MySQL" target="_blank">http://www.mysql.com/news-and-events/sun-to-acquire-mysql.html</a></p>
<p>I think the move is a good one for MySQL. With the recent purchase of the InnoDB storage engine by Oracle, there has been some concern that MySQL could end up in the hands of a company that&#8217;s best interests do not involve the open source community.</p>
<p>The recent influx of <a href="http://mysqldbnews.blogspot.com/2007/10/google-contributes-to-mysql.html" title="Google Contributes to MySQL" target="_blank">participation in the development of MySQL by Google</a> gives me a lot of hope that MySQL&#8217;s future will be a bright one. The next generation storage engine called <a href="http://dev.mysql.com/doc/refman/6.0/en/se-falcon.html" title="Falcon storage engine for MySQL" target="_blank">Falcon</a> hopes to become a replacement for InnoDB and many of the performance tweaks Google has implemented over the years will most likely find their way into the future versions of MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2008/01/28/sun-acquires-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will be on the 24hr podcast Friday at 2pm</title>
		<link>http://www.compiledweekly.com/2007/12/20/will-be-on-the-24hr-podcast-friday-at-2pm/</link>
		<comments>http://www.compiledweekly.com/2007/12/20/will-be-on-the-24hr-podcast-friday-at-2pm/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 19:43:48 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[podcasting]]></category>
		<category><![CDATA[24hr podcast]]></category>
		<category><![CDATA[geek news central]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/2007/12/20/will-be-on-the-24hr-podcast-friday-at-2pm/</guid>
		<description><![CDATA[I will be on the 24 hour podcast event planned for Friday, December 21 at 2pm.Â  I&#8217;ll be discussing download Statistics, web programming and answering questions anyone may have. More information is available at the Geek News Central.]]></description>
			<content:encoded><![CDATA[<p>I will be on the 24 hour podcast event planned for Friday, December 21 at 2pm.Â  I&#8217;ll be discussing download Statistics, web programming and answering questions anyone may have.</p>
<p>More information is available at the <a href="http://www.geeknewscentral.com/archives/007473.html" title="24hr podcast" target="_blank">Geek News Central</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2007/12/20/will-be-on-the-24hr-podcast-friday-at-2pm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP code to format Program Name for 1-click zune subscription</title>
		<link>http://www.compiledweekly.com/2007/12/05/php-code-to-format-program-name-for-1-click-zune-subscription/</link>
		<comments>http://www.compiledweekly.com/2007/12/05/php-code-to-format-program-name-for-1-click-zune-subscription/#comments</comments>
		<pubDate>Wed, 05 Dec 2007 16:07:13 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[podcasting]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/blog/2007/12/05/php-code-to-format-program-name-for-1-click-zune-subscription/</guid>
		<description><![CDATA[I added the Zune 1-click subscription option to the RawVoice properties at www.blubrry.com and www.techpodcasts.com. I ran into an issue where show titles that contain special characters, such as quotes, would break the rest of the web page. Below is the solution I implemented for the problem. Fix &#60;a href=&#8221;&#60; ?php $title_for_zune = ereg_replace(&#8216;[^A-Za-z0-9 ]&#8216;, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.compiledweekly.com/blog/wp-content/uploads/2007/12/zunelogo.gif" title="Zune" alt="Zune" align="right" border="0" height="36" width="108" />I added the <a href="http://zuneinsider.com/archive/2007/10/25/zune-1-click-podcast-subscriptions.aspx" title="Zune 1-click subscription" target="_blank">Zune 1-click subscription</a> option to the RawVoice properties at <a href="http://www.blubrry.com" title="www.blubrry.com" target="_blank">www.blubrry.com</a> and <a href="www.techpodcasts.com" title="www.techpodcasts.com" target="_blank">www.techpodcasts.com</a>. I ran into an issue where show titles that contain special characters, such as quotes, would break the rest of the web page.</p>
<p>Below is the solution I implemented for the problem.</p>
<p>Fix</p>
<blockquote><p>&lt;a href=&#8221;&lt; ?php<br />
$title_for_zune = ereg_replace(&#8216;[^A-Za-z0-9 ]&#8216;, &#8221;, $show_title);<br />
$title_for_zune = str_replace(&#8216; &#8216;, &#8216;_&#8217;, $title_for_zune);<br />
echo &#8216;zune://subscribe/?&#8217;.$title_for_zune.&#8217;=&#8217;.$feed;<br />
?&gt;&#8221; title=&#8221;Add to Zune&#8221;&gt;Add to Zune&lt;/a&gt;</p></blockquote>
<p>Having spaces in the URL does not validate, so I replace spaces with the _ character. If you are not worried about HTML validation, you can remove the str_replace function call.</p>
<p>I am not sure who came up with this protocol for the add to Zune 1-click subscription, as it does not appear to be very well thought out. Most other sites like Digg only require the feed url, which will never contain characters that could break your web pages.Â  As <a href="http://www.jasonvanorden.com/one-click-podcast-subscription-for-zune" title="Jason Van Orden on Zune 1-click subscription" target="_blank">Jason Van Orden</a> points out, the format is more complex than it needs to be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2007/12/05/php-code-to-format-program-name-for-1-click-zune-subscription/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Serious shortcomings with PHP5 get_headers() function</title>
		<link>http://www.compiledweekly.com/2007/07/13/serious-shortcomings-with-php5-get_headers-function/</link>
		<comments>http://www.compiledweekly.com/2007/07/13/serious-shortcomings-with-php5-get_headers-function/#comments</comments>
		<pubDate>Sat, 14 Jul 2007 02:26:38 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/blog/2007/07/13/serious-shortcomings-with-php5-get_headers-function/</guid>
		<description><![CDATA[I was writing some code to find out if a file exists on a server and if it does, have it return the size in bytes.Â  I found a useful function built into PHP 5, get_headers().Â  For getting file sizes, it works flawlessly.Â  For situations where the file does not exist on the server, the [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some code to find out if a file exists on a server and if it does, have it return the size in bytes.Â  I found a useful function built into PHP 5, get_headers().Â  For getting file sizes, it works flawlessly.Â  For situations where the file does not exist on the server, the behavior of this function was less than desirable.</p>
<p>Be forewarned, none of the user contributed get_headers() functions on the get_headers() documentation page on PHP.net will replicate the behavior of PHP 5&#8242;s get_headers() for URLs that use the &#8216;Location:&#8217; redirect header or return File Not Found headers.</p>
<p>According to RFC1945, A user agent should never automatically redirect a request more than 5 times, since such redirections usually indicate an infinite loop.Â  For true compatibility, the functions below should be able to handle up to 5 Location redirects within one function call.Â  Only the native get_headers() function exhibits this behavior.Â  None of the user contributed functions on PHP.net handle the &#8216;Location&#8217; redirection.</p>
<p>The native PHP &gt;= 5 get_headers() function will not return headers in some instances where the user contributed functions would.Â  For example, if the server returns a 404 status, get_headers() will throw a PHP warning.Â  Unfortunately, the 404 error can only be known by looking at the headers.Â  From first glance, all of the user contributed functions will return 404 headers, which may be a desired effect but does not replicate the behavior of the native get_headers() function.</p>
<p>The function I created is included below.Â  It works well if the file exists.Â  Unfortunately for the project I am using the code for, I also need to verify if the file exists on the server.Â  I will not be able to use this function.</p>
<p>&lt;CODE&gt;<br />
function remotefsize($url) {<br />
$sch = parse_url($url, PHP_URL_SCHEME);<br />
if (($sch != &#8220;http&#8221;) &amp;&amp; ($sch != &#8220;https&#8221;) ) {<br />
return false;<br />
}<br />
$headers = array_change_key_case(get_headers($url, 1),CASE_LOWER);<br />
if ((!array_key_exists(&#8220;content-length&#8221;, $headers)))<br />
return false;<br />
if( is_array($headers["content-length"]) )<br />
return array_pop($headers["content-length"]);<br />
return $headers["content-length"];<br />
}<br />
&lt;/CODE&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2007/07/13/serious-shortcomings-with-php5-get_headers-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save bandwidth and faster downloads with Apache mod_deflate</title>
		<link>http://www.compiledweekly.com/2007/07/02/save-bandwidth-and-faster-downloads-with-apache-mod_deflate/</link>
		<comments>http://www.compiledweekly.com/2007/07/02/save-bandwidth-and-faster-downloads-with-apache-mod_deflate/#comments</comments>
		<pubDate>Mon, 02 Jul 2007 14:59:45 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/blog/2007/07/02/save-bandwidth-faster-and-downloads-with-apache-mod_deflate/</guid>
		<description><![CDATA[I&#8217;ve been auditing apache web logs from statistics gathered in AWStats. I found 6 different IP addresses that are using a lot of the servers bandwidth. After looking at the logs, I discovered one of the IP addresses was a spammer and the rest are from web robots or bots. One bot used over 2.5GB [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been auditing apache web logs from statistics gathered in AWStats.  I found 6 different IP addresses that are using a lot of the servers bandwidth.  After looking at the logs, I discovered one of the IP addresses was a spammer and the rest are from web robots or bots.  One bot used over 2.5GB of traffic last month.  That is unbelievable.   That is 2.5% of the months bandwidth.  Of course Google and Yahoo combined have downloaded almost 30GB, but we want Google and Yahoo to index our sites.  So what can we do to save our bandwidth and still provide the information to the search engines?  Compress it with Mod_deflate!</p>
<p>The mod_deflate module in Apache is not new.  What is new is the trend to use it.  The deflate module uses gzip compression and is relatively fast in comparison to the bandwidth time.  You can do the math, but if your page was 1MB and took 20 seconds to download, and compressed it is 250k and takes 1 second to compress, 5 second to download, and 2 second to decompress, the compression method is faster.  You can crunch numbers till you are blue in the face, but the basic premise holds true.</p>
<p>First, you need to make sure the mod_deflate module is enabled in apache.  Look for the line in your apache configuration files and uncomment:</p>
<blockquote><p>LoadModule deflate_module modules/mod_deflate.so</p></blockquote>
<p>Then add the following lines within a &lt;Location&gt; or &lt;VirtualHost&gt; section.</p>
<blockquote><p> SetInputFilter DEFLATE</p></blockquote>
<p>The above will compress everything.  Instead of compressing everything, especially if you have a lot of files on your web site such as images, media, zip files, etc.. that are already compressed, you may want to only add compression for particular content types.  To compress specific content types, replace the SetInputFilter with one or more of the following.</p>
<blockquote><p>AddOutputFilterByType DEFLATE text/html<br />
AddOutputFilterByType DEFLATE text/plain<br />
AddOutputFilterByType DEFLATE text/xml<br />
AddOutputFilterByType DEFLATE text/css<br />
AddOutputFilterByType DEFLATE text/javascript<br />
AddOutputFilterByType DEFLATE application/x-javascript<br />
AddOutputFilterByType DEFLATE application/xml<br />
AddOutputFilterByType DEFLATE application/x-httpd-php</p></blockquote>
<p>If you work with other content types such as application/xml, you can add those as well.</p>
<p>You can test your server by using the GID Network gzip test located here: <a href="http://www.gidnetwork.com/tools/gzip-test.php" title="GID Network gzip test" target="_blank">http://www.gidnetwork.com/tools/gzip-test.php</a></p>
<p>Now that your web server is using compression, you can focus on other things like programming or eating pizza.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2007/07/02/save-bandwidth-and-faster-downloads-with-apache-mod_deflate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache and PHP performance tips, tricks and what I call database buffering</title>
		<link>http://www.compiledweekly.com/2007/06/23/apache-and-php-performance-tips-tricks-and-what-i-call-database-buffering/</link>
		<comments>http://www.compiledweekly.com/2007/06/23/apache-and-php-performance-tips-tricks-and-what-i-call-database-buffering/#comments</comments>
		<pubDate>Sat, 23 Jun 2007 20:26:38 +0000</pubDate>
		<dc:creator>angelo</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.compiledweekly.com/blog/2007/06/23/apache-and-php-performance-tips-tricks-and-what-i-call-database-buffering/</guid>
		<description><![CDATA[I&#8217;ve found a couple useful web sites to help tune Apache with PHP on web servers. phpLens has a pretty detailed page on the subject that hits everything pretty well. Link: http://phplens.com/phpeverywhere/tuning-apache-php For the most part I agree with everything this page says.Â  I do have a few other suggestions though. Addressing the 3rd suggestion [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found a couple useful web sites to help tune Apache with PHP on web servers.</p>
<p>phpLens has a pretty detailed page on the subject that hits everything pretty well.</p>
<blockquote><p>Link: <a href="http://phplens.com/phpeverywhere/tuning-apache-php" title="Tuning Apache and PHP for Speed on Unix" target="_blank">http://phplens.com/phpeverywhere/tuning-apache-php</a></p></blockquote>
<p>For the most part I agree with everything this page says.Â  I do have a few other suggestions though.</p>
<p>Addressing the 3rd suggestion on the phpLens tuning Apache and PHP post, I recommend turning compression on for specific content types using the mod deflate module in Apache 2.0 or greater.Â  Apache 1.3 uses a different compression module which is a bit more complicated to setup.Â  Here is a link on ClarkConnect that describes how to add the deflate support to your web site and track its statistics with awstats.Â  Don&#8217;t forget to compress javascript, css and xml as well as html.</p>
<blockquote><p>Link: <a href="http://www.clarkconnect.com/wiki/index.php?title=Howtos_-_Activating_content_compression_on_Apache" title="Howtos - Activating content compression on Apache" target="_blank">http://www.clarkconnect.com/wiki/index.php?title=Howtos_-_Activating_content_compression_on_Apache</a></p></blockquote>
<p>Web server or module level PHP accelerators seem ideal for speeding up the performance of php scripts.Â  Though the 6th suggestion, I would debate whether caching pages in the PHP level is faster or not.Â  Libraries like Smarty are great for templating your pages but they have their limits.Â  If you are hosting a web site with constantly changing dynamic content, the caching built into Smarty is minimal at best.Â  Granted that your original PHP script was well written, the cached Smarty version technically can&#8217;t re-optimize your database queries, which is most likely the source of any delays with a dynamic web page.</p>
<p>One suggestion that is missing from the post is optimizing your SQL queries and methods how you select the data.Â  phpLens mentions the concept of output buffering.Â  What I am about to explain is similar and should be deployed together.Â  First and for most, when you are working with a result set of data from a database, loop through all the data and store it in variables as quickly as you can and free up that queries resource.Â  This will use the time you are connected to the database as efficiently as possible and prevent you from accidentally creating nested queries.Â  Since this practice is very similar to output buffering, perhaps we should call it &#8216;database buffering&#8217;.Â  The database may still buffer data as well, but your script knows better than the database what to do with the selected data and your script definitely knows what queries are going to happen next.Â  Database buffering practices just make sense.</p>
<p>I would also recommend testing your web sites for security issues.Â  Check out Nikto, it is a pretty powerful web server scanner that looks for vulnerabilities and security issues.</p>
<blockquote><p>Link: <a href="http://www.cirt.net/code/nikto.shtml" title="Nikto" target="_blank">http://www.cirt.net/code/nikto.shtml</a></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.compiledweekly.com/2007/06/23/apache-and-php-performance-tips-tricks-and-what-i-call-database-buffering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
