<?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>Colin Godsey &#187; PHP</title>
	<atom:link href="http://www.colingodsey.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.colingodsey.com</link>
	<description>CRG Studios &#38; Consulting</description>
	<lastBuildDate>Sat, 06 Mar 2010 00:09:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Redis: Persistent Memory Key-Value Store</title>
		<link>http://www.colingodsey.com/redis-persistent-memory-db/</link>
		<comments>http://www.colingodsey.com/redis-persistent-memory-db/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 03:02:22 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/?p=202</guid>
		<description><![CDATA[Just today I was challenged with a project that will require value caching in a PHP/MySQL cluster environment. This project will have to deal with loads of up to 500 requests per second, most of which will involve writes. When working on a small scale it is easy to forget the latency issues associated with [...]]]></description>
			<content:encoded><![CDATA[<p>Just today I was challenged with a project that will require value caching in a PHP/MySQL cluster environment. This project will have to deal with loads of up to 500 requests per second, most of which will involve writes. When working on a small scale it is easy to forget the latency issues associated with all engines in MySQL. This project will require a massive read/write caching system that will sit between PHP and MySQL and will require full data persistence. I found a valuable article that shows some of the timing differences of the <a href="http://www.ruturaj.net/redis-memcached-tokyo-tyrant-mysql-comparison" target="_blank">popular storage systems under load</a>. Redis seems to be the real winner here. With write-only data persistence (write to disk), this storage engine still comes out on top! This is truly the best system if you are caching write calls to MySQL. This way, most of the data will survive in case of a crash. Persistence can be increased even further by using another fully redundant Redis server. This is a must have for high-load write caching.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/redis-persistent-memory-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Use LDAP Over SSL w/ PHP</title>
		<link>http://www.colingodsey.com/how-to-use-ldap-over-ssl-w-php/</link>
		<comments>http://www.colingodsey.com/how-to-use-ldap-over-ssl-w-php/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 05:00:06 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/how-to-use-ldap-over-ssl-w-php/</guid>
		<description><![CDATA[LDAP authentication through PHP can be quite handy. With methods such as this, authentication can be done against an LDAP user database. This is convenient if you are writing software that you would like to interface against an established user platform. I ran into this writing software for Northern Illinois University that had an established [...]]]></description>
			<content:encoded><![CDATA[<p>LDAP authentication through PHP can be quite handy. With methods such as this, authentication can be done against an LDAP user database. This is convenient if you are writing software that you would like to interface against an established user platform. I ran into this writing software for Northern Illinois University that had an established staff and student user database with set password management and user information through Novell.</p>
<p>One of the requirements was the connection had to be through a secure tunnel. So using Apache, PHP, php-ldap module, OpenLDAP and OpenSSL on Fedora Core 5 I was able to do this.</p>
<p>The system started with the Apache, PHP and the php-ldap module installed. A custom configure of OpenLDAP had to be done. I <a href="http://www.openldap.org/">downloaded the newest version</a> from the site and configured and installed it with <em>&#8211;with-tls &#8211;enable-slapd. </em> After installing OpenLDAP, I had to add the line <em>TLS_REQCERT never</em> to the end of <em>/etc/openldap/ldap.conf</em>. This option may be needed if you are having certificate troubles.</p>
<p>The following are the two functions i used in PHP to actually do the authentication.</p>
<blockquote><p>function ia_ldap_search($ds, $user) {<br />
$sr=ldap_search($ds, &#8220;o=NIU&#8221;, &#8220;cn=$user&#8221;);<br />
$info = ldap_get_entries($ds, $sr);</p>
<p>return $info[0];<br />
}</p>
<p>function ldap_auth($user, $pass, $search=false) {<br />
$ds=ldap_connect(_IA_STREAM);</p>
<p>if($search) {<br />
$info=ia_ldap_search($ds, $user);<br />
$user=$info['dn'];<br />
} else $info=$user;</p>
<p>$r=@ldap_bind($ds, $user, $pass);<br />
ldap_close($ds);</p>
<p>return $r ? $info : 0;<br />
}</p></blockquote>
<p>_IA_STREAM is a define I provided previously that is the URI of the LDAPS server (<em>ldaps://host:636</em>). These two functions should provide you with the basics from LDAP authentication over SSL. The ldap_auth function takes the username and password and returns the user info if validated, or 0 for failed. Username search can be done by providing the username and settings <em>$search</em> to true when calling the function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/how-to-use-ldap-over-ssl-w-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Change Default Wordpress Thumbnail Size</title>
		<link>http://www.colingodsey.com/how-to-change-default-wordpress-thumbnail-size/</link>
		<comments>http://www.colingodsey.com/how-to-change-default-wordpress-thumbnail-size/#comments</comments>
		<pubDate>Thu, 20 Dec 2007 16:10:14 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/how-to-change-default-wordpress-thumbnail-size/</guid>
		<description><![CDATA[It&#8217;s nice to be able to change the default thumbnail size for image uploads in Wordpress. I upload tons of big pictures and it&#8217;s nice if the thumbnail just fits within the content width. So here is an easy way to make this change in Wordpress. They have introduced the wp_thumbnail_max_side_length filter that can be [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s nice to be able to change the default thumbnail size for image uploads in Wordpress. I upload tons of big pictures and it&#8217;s nice if the thumbnail just fits within the content width. So here is an easy way to make this change in Wordpress. They have introduced the <em>wp_thumbnail_max_side_length</em> filter that can be used to change the default size in plugings and so forth, but this is far easier.</p>
<p>Navigate to your <em>wp-admin</em> folder in your Wordpress installation. Edit <em>admin-functions.php</em> and head to line <em>2228</em>.  You should find this line:</p>
<p><code>$max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );</code></p>
<p>The default max size is <em>128</em>px. You can choose what you want for this now. This size determines the maximum size of any side of the image. For my template though, I only care about width. I always want the thumbnail to be as wide as the template. To make that change, go to line <em>2276</em> of the <em>admin-functions.php</em> file. Change the following line:</p>
<p><code>if ( $image_attr[0] &gt; $image_attr[1] ) {</code></p>
<p>To:</p>
<p><code>//if ( $image_attr[0] &gt; $image_attr[1] ) {<br />
if (1) {</code></p>
<p>That&#8217;s it! Now Wordpress will always scale the thumbnail according to the width. Save your changes and try em out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/how-to-change-default-wordpress-thumbnail-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook API &#8211; FQL For Friends With App</title>
		<link>http://www.colingodsey.com/facebook-api-fql-for-friends-with-app/</link>
		<comments>http://www.colingodsey.com/facebook-api-fql-for-friends-with-app/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 18:12:56 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/facebook-api-fql-for-friends-with-app/</guid>
		<description><![CDATA[The Facebook API gives you the option of using FQL (Facebook Query Language) to retrieve data instead of using the built in API calls. I thought this was unnecessary until I needed a quick query to get me the list of a users friends with the current application added. After some research, I came across [...]]]></description>
			<content:encoded><![CDATA[<p>The Facebook API gives you the option of using FQL (Facebook Query Language) to retrieve data instead of using the built in API calls. I thought this was unnecessary until I needed a quick query to get me the list of a users friends with the current application added. After some research, I came across the following query:</p>
<p><code>$facebook-&gt;api_client-&gt;fql_query("SELECT uid FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1 = $user)");</code></p>
<p>This returns a nice quick list I can use in the multi-friend selector for excluded IDs in the &#8217;share&#8217; part of the application as well as a quick number for how many friends have already added the application. This can be very useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/facebook-api-fql-for-friends-with-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>QuoteShare Facebook Application</title>
		<link>http://www.colingodsey.com/quoteshare-facebook-application/</link>
		<comments>http://www.colingodsey.com/quoteshare-facebook-application/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 19:53:41 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/quoteshare-facebook-application/</guid>
		<description><![CDATA[QuoteShare is my new PHP Facebook application. I will be journaling several of my difficulties with this app up here on my blog. Facebook apps seem to always give me the weirdest problems available, and those are always good to share with others.
The app so far is very simple: it is scheduled to pull quotes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://apps.facebook.com/quoteshare" target="_blank">QuoteShare</a> is my new PHP Facebook application. I will be journaling several of my difficulties with this app up here on my blog. Facebook apps seem to always give me the weirdest problems available, and those are always good to share with others.</p>
<p>The app so far is very simple: it is scheduled to pull quotes from you and your friends&#8217; profiles and to break them up and place just single quotes randomly on your profile in the QuoteShare box. Check out the screen shot below.</p>
<p><img src="http://www.colingodsey.com/wp-content/uploads/2007/11/qs.png" alt="QuoteShare" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/quoteshare-facebook-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy thumbnail mod for phpLD</title>
		<link>http://www.colingodsey.com/easy-thumbnail-mod-for-phpld/</link>
		<comments>http://www.colingodsey.com/easy-thumbnail-mod-for-phpld/#comments</comments>
		<pubDate>Mon, 12 Nov 2007 17:50:17 +0000</pubDate>
		<dc:creator>Colin Godsey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[phpld]]></category>

		<guid isPermaLink="false">http://www.colingodsey.com/easy-thumbnail-mod-for-phpld-using-artviper-api/</guid>
		<description><![CDATA[This mod is pretty easy. All it requires is a template change to add in the image location for the thumbnail API and a new cell in the table. Open up your link.tpl file for the phpLD theme you are using. Near the top of the template, right after the table and first row are [...]]]></description>
			<content:encoded><![CDATA[<p>This mod is pretty easy. All it requires is a template change to add in the image location for the thumbnail API and a new cell in the table. Open up your <strong>link.tpl</strong> file for the phpLD theme you are using. Near the top of the template, right after the table and first row are opened (&lt;table&gt;&lt;tr&gt;) add the following:</p>
<p><code>&lt;td style="height: 90px; width: 120px"&gt;<br />
&lt;img src="http://www.artviper.net/screenshots/screener.php?url={$link.URL|escape|trim}"<br />
alt="Thumbnail" /&gt;<br />
&lt;/td&gt;<br />
</code></p>
<p>That should be it! The thumbnails take a bit to be cached, but after they&#8217;re loaded once they should load quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.colingodsey.com/easy-thumbnail-mod-for-phpld/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
