<?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>HidayahTech &#187; PHP</title>
	<atom:link href="http://blog.basilgohar.com/category/development/php/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.basilgohar.com</link>
	<description>Technology, Development, &#38; Interesting Stuph</description>
	<lastBuildDate>Tue, 08 Nov 2011 15:49:03 +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>Moodle 2.0 released!</title>
		<link>http://blog.basilgohar.com/2010/11/24/moodle-2-0-released</link>
		<comments>http://blog.basilgohar.com/2010/11/24/moodle-2-0-released#comments</comments>
		<pubDate>Wed, 24 Nov 2010 21:28:16 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Society]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[moodle]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/?p=523</guid>
		<description><![CDATA[Alḥamdulillāh, Moodle 2.0 has been released! This is important for a lot of reasons, amongst them being that I work with Moodle on a day-to-day basis in my daytime job, and I use it on some of my own sites.  However, most important is the fact that Moodle provides a platform for education that is [...]]]></description>
			<content:encoded><![CDATA[<p><em>Alḥamdulillāh</em>, <a title="Moodle 2.0 is now available!" href="http://moodle.org/mod/forum/discuss.php?d=162906">Moodle 2.0 has been released</a>! This is important for a lot of reasons, amongst them being that I work with Moodle on a day-to-day basis in my daytime job, and I use it on some of my own sites.  However, most important is the fact that Moodle provides a platform for education that is free-as-in-freedom and the community supports this philosophy through-and-through.</p>
<p>Moodle 2.0 brings an incredibly wide range of new features and capabilities that further extend what is possible.  I personally have worked on some of the new features in a minor capacity &#8211; both in submitting bug reports as well as helping to implement some milestones in line with what we needed at work.</p>
<p>Moodle is used on countless sites to provide education and share knowledge in every corner of the world.  So, congratulations to the Moodle team and to the world for this great step forward!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2010/11/24/moodle-2-0-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unfinished Projects</title>
		<link>http://blog.basilgohar.com/2009/02/23/unfinished-projects</link>
		<comments>http://blog.basilgohar.com/2009/02/23/unfinished-projects#comments</comments>
		<pubDate>Mon, 23 Feb 2009 13:48:17 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Audio Islam]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Islam]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/?p=419</guid>
		<description><![CDATA[Bismillaahir Rahmaanir Raheem I have the bad habit of starting things and not completing them.  This is bad for numerous reasons, just a few of which I&#8217;ll list shortly.  I will warn you now that as this post is meant to help me organize my thoughts, it will list-heavy, as I do find lists and [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em>Bismillaahir Rahmaanir Raheem</em></p>
<p style="text-align: left;">I have the bad habit of starting things and not completing them.  This is bad for numerous reasons, just a few of which I&#8217;ll list shortly.  I will warn you now that as this post is meant to help me organize my thoughts, it will list-heavy, as I do find lists and other types of grouping structures to be beneficial and help in making relationships (e.g., database schemes).</p>
<p style="text-align: left;">I already know that as I type this I will revisit this post in the future as I will be unable, in one sitting, to be think of all of unfinished projects.  Therefore, I will come back and add to the list as I recall more things (and find the time and desire, a rare combination these days, to update the blog).</p>
<p style="text-align: left;">For</p>
<ul>
<li>Unfinished projects tend to clutter your mind
<ul>
<li>I tend to turn to unfinished projects whenever I work (i.e., get paid to do something) and hit a stumbling block.  This severely hinders my progress on work, which ultimately leads to less getting done.</li>
<li>Time when I could be brainstorming solutions is usually spent wondering about these myriad unfinished projects, which, lacking much focus, tend to yield few to no tangible solutions.  This includes walking/riding to the masjid, showering, and other activities that tend to leave the brain free and, ideally, well-suited for addressing beneficial thoughts.</li>
<li>If I try to focus on something, I can have a hard time preventing my mind from wandering to these unfinished projects.  This is related to the point about work above.</li>
<li>It&#8217;s just not healthy to have so many things on the mind at once.  There is a point at which the benefit of multitasking is overshadowed by the overhead of just trying to keep track of everything.  It&#8217;s not efficient.</li>
</ul>
</li>
<li>Having so many unfinished projects means that it can be hard to pick just one to work on.</li>
<li>Playing catch-up may give a false sense of achievement, because the value of these unfinished projects are not equal, and therefore, I may complete one that is really not that important while one that is more valuable was never completed.  Therefore, just trying to clear out the backlog of projects may yield a net result of close to zero.</li>
<li>There are many more, and I may amend this list in the future as I recall them.</li>
</ul>
<p>So, here is the list of my unfinished projects (at least those that I can recall at one point or another).  I am including some thoughts on the different ideas as well.</p>
<ul>
<li>Redesign the Audio Islam website</li>
<li>Write a script to automatically tag all the audio files, especially the ones containing Qurʾān recitation, with reciter &amp; sūrah information</li>
<li>The Fedora Documentation manpage coverage project
<ul>
<li>This is basically an idea I had related to the Fedora Documentation project to ensure that all executables had an associated man page (manual page, a low-level documentation system for Unix-like operating systems such as GNU/Linux).</li>
<li>The first step in this is to canvass the existing packages &amp; executables and see what already has a man page.  I have already started on this, but there is much work left to be done.</li>
<li>There are plenty of sources for documentation that can be used as baseline manpages, including the Debian project.  So, this project doesn&#8217;t require as much work as it does just coordinating and facilitating.</li>
</ul>
</li>
<li>A Paltalk replacement
<ul>
<li>Paltalk is a voice conference &amp; chat application (video is also supported, but I don&#8217;t care about that right now) that is widely used, but terribly proprietary.</li>
<li>My goal is to create or synthesize a replacement for Paltalk using only free software and open technologies
<ul>
<li>The best candidates for this are SIP (for multimedia) and Jabber/XMPP (for text chat).</li>
<li>The landscape for software that can do this in a simple fashion is rather bleak, but there are some solutions.</li>
<li>I&#8217;m currently focused on FreeSWITCH as the SIP server and ejabberd as the chat backend.</li>
<li>Linking them such that it will be one service will be quite challenging, and still requires a free software client that has solid support for both SIP &amp; XMPP
<ul>
<li>I&#8217;ve been looking mostly at Qutecom, SIP Communicator, and Psi</li>
</ul>
</li>
</ul>
<ul>
<li>
<ul>
<li>On GNU/Linux, the Empathy client for the Telepathy framework is outstanding, but, is limited to free-software operating systems.  I think Windows support is a long way out still.</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>AlMaghrib in Malaysia
<ul>
<li>I am trying to catalyze the establishment of AlMaghrib Institute seminars in Malaysia (almost surely in Kuala Lumpur, at least at the beginning).</li>
<li>I&#8217;ve already purchased the domains almaghribinmalaysia.com/net/org, and I just need to get the site setup.
<ul>
<li>To start off, I think just a blog with some information about AlMaghrib is fine.  It can be fleshed-out later.</li>
</ul>
</li>
<li>Alḥamdulillāh, there is already a lot of interest both within and without Malaysia.  I have several contacts here that are also excited and may be able to facilitate the first few steps.
<ul>
<li>I see the first step being getting a group of excited &amp; enthusiastic locals to get behind the effort.</li>
<li>After that group is identified (and it is really an ongoing process), see about getting the support of existing organizations.
<ul>
<li>From an initial perspective, it seems like this is going to be easy, in shāʾ Allāh.</li>
</ul>
</li>
<li>With this support, we will want to schedule some kind of event to gain a wider audience interest.  Something like a conference or teaser seminar, perhaps a week-long program with some of the AlMaghrib instructors.
<ul>
<li>Many of the AlMaghrib instructors are already known or well-known here</li>
<li>Having Suhaib Webb might be particularly nice, as his wife is Malaysian.</li>
<li>Waleed Basyouni has expressed an interest in coming to Malaysia, and some work is already in progress regarding that, but it may have stalled (temporarily only, in shāʾ Allāh)</li>
<li>Yasir Qadhi is another instructor that has some reknown here, apparently (from what I&#8217;ve been told).</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>HidayahTech
<ul>
<li>My own technology consulting business</li>
<li>Although HidayahTech is currently the name of my blog, I have also resolved to use this as the name for my own consulting business.</li>
<li>Services will include
<ul>
<li>Audio recording, editing, mastering, and production (I did this, for example, for the Texas Dawah Convention in 2007)
<ul>
<li>I am consider splitting this and other audio-related services into it&#8217;s own business, namely, <em>Hidayah Audio</em></li>
</ul>
</li>
<li>Web technologies
<ul>
<li>Hosting (this is generally quite easy)</li>
<li>Moodle (an open-source learning mangement system, for putting schools online, for example)</li>
<li>Audio services, including hosting my &#8220;replacement for Paltalk&#8221; solution above</li>
</ul>
</li>
<li>Consulting
<ul>
<li>This will include a wide variety of services ranging from system administration, general IT, infrastructure, to web development</li>
<li>I may take some partners or hire some friends for this aspect of this business, as I will need help for some points of it</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>Global Homeschooling
<ul>
<li>This is my premiere project, if I had to pick one.  I consider this to be something great if I can achieve it, by the Permission of Allāh.</li>
<li>To sum it up, I want to develop a system whereby Muslims (and truly, anyone) can homeschool their own children easily.  Homeschooling may be too specific of a term, though, because I want the scale to include a plan that can be implemented by governments.  I would like children, and really anyone, to be able to be educated within their own homes, utilizing the bevy of technology that exists.</li>
<li>Technology creates options &amp; opportunities, and this is a belief I take strongly.  Therefore, I think we should utilize it.  I see education as one of the most important investments that can be made, whether it is Islamic or related to the worldly sciences, both of which are important.  I actually believe the distinction to be artificial, but it will take time to get there.</li>
<li>So, to put it in a few words, I would like to develop a system of education leveraging technology that is globally accessible allowing education to be released from the confines of school <em>buildings</em>.</li>
</ul>
</li>
<li>Learn the Python programming language
<ul>
<li>I think learning Python has a high return value on the types of applications I would like to write, including graphical ones.  Also, it is quite the preferred language for many platforms, not the least of which is Red Hat &amp; Fedora.</li>
</ul>
</li>
<li>Memorize the Qurʾān
<ul>
<li>Please keep in mind that this list isn&#8217;t in order of importance&#8230;;)</li>
<li>I think this is a goal every Muslim should have.  I started this goal, seriously, while I was staying in Egypt with my parents, even semi-regularly visiting the imān of the nearby masjid to review my memorization.  Sadly, since arriving in Malaysia I&#8217;ve not really resumed, and I am afraid I may start regressing.  This is the kind of project that can be achieved through a little, regular &amp; constant work every day.  I really should commit to something, even if it is as simple as <em>one āyāh</em> per day.  That would be better than <em>none</em>.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2009/02/23/unfinished-projects/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Concatenating compressed files</title>
		<link>http://blog.basilgohar.com/2009/01/03/concatenating-compressed-files</link>
		<comments>http://blog.basilgohar.com/2009/01/03/concatenating-compressed-files#comments</comments>
		<pubDate>Sat, 03 Jan 2009 13:01:42 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/?p=308</guid>
		<description><![CDATA[Bismillaahir Rahmaanir Raheem I have my new server (aalimraan.hidayahonline.net &#8211; the one hosting Audio Islam) setup to log web accesses each day to its own file which is then bzip2-compressed.  This is convenient for a variety of reasons. Firstly, I can easily access statistics for each day by processing the appropriate file. B, I can [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em>Bismillaahir Rahmaanir Raheem</em></p>
<p>I have my new server (aalimraan.hidayahonline.net &#8211; the one hosting <em>Audio Islam</em>) setup to log web accesses each day to its own file which is then bzip2-compressed.  This is convenient for a variety of reasons.</p>
<ul>
<li>Firstly, I can easily access statistics for each day by processing the appropriate file.</li>
<li>B, I can see the relative activity on each day at a glance by seeing the size of the file, keeping in mind it&#8217;s only a rough estimate since compression can skew the results (e.g., many requests for the same, exact URL may compress much more than fewer, disparate URL requests, resulting in a smaller file and a seemingly less active day)</li>
<li>3, by being compressed text files, they take up very, very little space.</li>
</ul>
<p><span id="more-308"></span>The fact that the files are compressed using bzip2 means they are relatively tiny (by an order of magnitude compared with their uncompressed forms).  On top of this, I can easily access their contents using bzcat, which simply decompresses the files on the fly, allowing me to redirect the uncompressed text stream to whatever utility I&#8217;m hoping to process them with &#8211; such as grep, wc, or whatever.</p>
<p>So, I wanted to download the files in bulk to my laptop at home so I could write a PHP script that will process the access logs and store them in a database so I can extract all kinds of goodies from them such as which sites link to <em>Audio Islam</em> the most, which URLs are the most popular, and so on.  So, rather than download all the separate files individually, I wanted to concatenate the log files created thus far into one larger file so that I could just download it in one go.  Additionally, several text files concatenated together would naturally yield a smaller file (at least, so one would assume).</p>
<p>So, I ran the following command (or something like it):<br />
<code>cat access_log*.bz2 | bzip2 -c | ~/aalimraan.hidayahonline.org-access_log-20081226.bz2</code><br />
The intention being that I wanted to create one large bzip2-compressed file as the concatenation of all the other, smaller daily files by first decompressing them into a continuous text stream (as if it were one large log file) and then recompressing them into the larger, single file.  But when I got around to processing that file on my local machine, the uncompressed output was garbage!  I was surprised, and then an idea hit me &#8211; I decided to run the uncompressed output through bzcat once again (the idea being that I am now decompressing it twice).  Lo and behold, the output of that invocation was something that looked astonishingly like a web server access log!  So what happened?</p>
<p>Look closely at my command, and you&#8217;ll see that I made the quite silly mistake of using plain old</p>
<pre>cat</pre>
<p>instead of</p>
<pre>bzcat</pre>
<p>.  Thus, I was recompressing a stream of already bzip2-compressed files, which is, to say the least, quite pointless.  In fact, the resulting file is all but useless to me, because I cannot really tell where one file begins or ends, so I only get output from the first bzip2 file.</p>
<p>Needless to say, let this be a lesson to make sure, when piping data around, you know what you&#8217;re doing.</p>
<p>This has been a public service announcement from you local system admin.  Thank you for listening!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2009/01/03/concatenating-compressed-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Naïve integer primality calculator in PHP</title>
		<link>http://blog.basilgohar.com/2008/08/24/naive-integer-primality-calculator-in-php</link>
		<comments>http://blog.basilgohar.com/2008/08/24/naive-integer-primality-calculator-in-php#comments</comments>
		<pubDate>Sun, 24 Aug 2008 22:52:52 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/?p=222</guid>
		<description><![CDATA[Bismillaahir Rahmaanir Raheem Alhamdulillaah, while reading about integers and, subsequently, prime numbers last night, I decided the time had come for me to write a primality calculator in PHP.  The test I use in my implementation is about as a naïve as one can possible get, but it was fun, nonetheless. Interestingly enough, I discovered [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em>Bismillaahir Rahmaanir Raheem</em></p>
<p><em>Alhamdulillaah</em>, while reading about <a title="Wikipedia article for &quot;Integer&quot;" href="http://en.wikipedia.org/wiki/Integer">integers</a> and, subsequently, <a title="Wikipedia article for &quot;Prime number&quot;" href="http://en.wikipedia.org/wiki/Prime_number">prime numbers</a> last night, I decided the time had come for me to write a primality calculator in PHP.  The <a title="Wikipedia article for &quot;primality test&quot;" href="http://en.wikipedia.org/wiki/Primality_test">test</a> I use in my implementation is about as a naïve as one can possible get, but it was fun, nonetheless.</p>
<p>Interestingly enough, I discovered that there already exists a primality calculator for *nix-based systems &#8211; primes.  It comes with the bsd-games package for Fedora.  I assume the same is true for other distributions.  Mine isn&#8217;t quite as fast yet&#8230;but it does accept, optionally, one or two arguments.  If there are two arguments, then it will calculate all primes starting from the first going until the second.  If there is only one argument, it will calculate from PRIME_START (defined to be 2) through to the largest integer PHP can handle on your platform (usually the maximum value of a signed int on your machine).</p>
<p>There are loads of potential optimizations that  can be performed, and this was just something written on a whim as a proof of concept.  It seems to be accurate, however.  The code, released under the <a title="GNU General Public License 3.0" href="http://www.gnu.org/licenses/gpl-3.0.html">GNU GPL v. 3.0</a>, can be found below.<br />
<span id="more-222"></span></p>
<blockquote><pre>#!/usr/bin/php
< ?php

define('PRIME_START', 2);   //  One, by definition, is not prime

if (isset($argv[2])) {
    $start = (int) $argv[1];
    $max = (int) $argv[2];
} elseif (isset($argv[1])) {
    $start = (int) PRIME_START;
    $max = (int) $argv[1];
} else {
    $start = PRIME_START;
    $max = PHP_INT_MAX;
}

if ($start < PRIME_START) {
    $start = PRIME_START;
}

if ($max < PRIME_START) {
    $max = PHP_INT_MAX;
}

echo "Using $start as start value and $max as max value\n";

$int = $start;

while ($int < $max) {
    $start_time = microtime(true);
    if (is_prime($int)) {
        $total_time = round((microtime(true) - $start_time), 2);
        echo "$int is prime (calculated in {$total_time}s)\n";
    }
    ++$int;
}

echo "All possible primes lower than $max have been calculated!\n";

/**
 * A very naïve test to determine the primality of a given integer
 *
 * @param int $int
 * @return boolean integer is prime
 */
function is_prime($int)
{
    if (! is_numeric($int)) {
        return false;
    }

    $int = (int) $int;

    $test_divisor = PRIME_START; //  By coincidence, the first divisor to determine prime numbers is also the first prime number

    while ($test_divisor < $int) {
        if (is_divisor($int, $test_divisor)) {
            return false;
        }
        ++$test_divisor;
    }

    //  If we are here, then that means no divisors were found
    return true;
}

/**
 * Very simple function to determine if one integer is the divisor of another
 *
 * @param int $dividend
 * @param int $divisor
 * @return boolean $divisor is divisor of dividend
 */
function is_divisor($dividend, $divisor)
{
    if (0 === $dividend % $divisor) {
        return true;
    } else {
        return false;
    }
}
</pre>
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2008/08/24/naive-integer-primality-calculator-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Audio Islam now running on lighttpd</title>
		<link>http://blog.basilgohar.com/2008/08/16/audio-islam-now-running-on-lighttpd</link>
		<comments>http://blog.basilgohar.com/2008/08/16/audio-islam-now-running-on-lighttpd#comments</comments>
		<pubDate>Sun, 17 Aug 2008 04:59:32 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Audio Islam]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/?p=212</guid>
		<description><![CDATA[Bismillaahir Rahmaanir Raheem Alhamdulillaah, I&#8217;ve been able to make some major- and sorely-needed-upgrades to Audio Islam.  Interestingly enough, for the vast majority of people, these changes won&#8217;t really be that visible as they are all behind-the scenes. The desire to upgrade Audio Islam has been around for a long time, and I still have many [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><em>Bismillaahir Rahmaanir Raheem</em></p>
<p><em>Alhamdulillaah</em>, I&#8217;ve been able to make some major- and sorely-needed-upgrades to <a title="Audio Islam website" href="http://www.audioislam.com/"><em>Audio Islam</em></a>.  Interestingly enough, for the vast majority of people, these changes won&#8217;t really be that visible as they are all behind-the scenes.</p>
<p><span id="more-212"></span>The desire to upgrade <em>Audio Islam</em> has been around for a long time, and I still have many more changes, particularly in relation to the code, that are pending.  But I decided to focus on performance due to the vast surge in visitors that will come during the month of Ramadhaan, in shaaʾ Allaah.  Therefore, I had to polish some things, upgrade others, and in some cases, fundamentally change them!</p>
<p>Prior to today, <em>Audio Islam</em> was running a typical <a title="Wikipedia article for &quot;LAMP&quot;" href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)">LAMP</a> setup &#8211; <a title="Red Hat website" href="http://www.redhat.com/">Red Hat</a> <a title="Red Hat Enterprise Linux website (note: this current version as of this writing is 5)" href="http://www.redhat.com/rhel/">Enterprise Linux</a> 4, <a title="Apache Software Foundation website" href="http://www.apache.org/">Apache</a> <a title="Apache HTTP Server website" href="http://httpd.apache.org/">HTTP Server</a>, <a title="MySQL website" href="http://www.mysql.com/">MySQL</a> database server, &amp; <a title="PHP website" href="http://www.php.net/">PHP Hypertext Preprocessor</a>.  Also typically, at the <a title="PHP FAQ entry &quot;Why shouldn't I use Apache2 with a threaded MPM in a production environment?&quot;" href="http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2">behest</a> of the PHP developers, my Apache HTTP server was configured to operate in <a title="Apache MPM prefork" href="http://httpd.apache.org/docs/2.2/mod/prefork.html">prefork</a> mode, which, to put it simply, causes the web server to assign one process per web request.</p>
<p>For a site like <em>Audio Islam</em>, where currently the programming logic is rather limited and the bulk of the action involves downloading of large files, the cautions that call for using the prefork mode, as opposed to the more performant multi-threaded <a title="Apache MPM worker" href="http://httpd.apache.org/docs/2.2/mod/worker.html">worker</a> mode, are less urgent, so I opted for the more efficient mode due to <em>Audio Islam</em>&#8216;s need for very high concurrency on rather modest server hardware.  I&#8217;ve had to set the maximum number of clients in my webserver to over 700 and also offset the more popular mode of download to be FTP just to keep the website accessible, so I am very keen to seek out as much optimization as I can until I can move to another server that will sustain the site as well as this one in terms of bandwidth (currently, 20Mbit/s unmetered is keeping the site afloat, alhamdulillaah).</p>
<p>However, here is where the multi-threaded madness of PHP reared its ugly head.  In truth, I am not entirely sure that I can lay the blame solely on PHP here, but as PHP is not generally multi-threaded enabled and intends to stay that way, I don&#8217;t feel so keen on removing them from the blame completely, either.</p>
<p>Before going further, here&#8217;s a summary of the specific versions of each package (before/after)</p>
<ul>
<li>Apache HTTP Server: 2.2.0/2.2.9</li>
<li>MySQL database server: 5.0.16/5.0.67</li>
<li>PHP Hypertext Preprocessor: 5.1.6/5.2.3</li>
</ul>
<p>As I install all my servers from source on my aging Red Hat platform in order to get the latest versions easily, that means I have the pleasure of compiling all my packages from source (I haven&#8217;t figured-out how to make my own RPMs yet&#8230;).  So, my first step was to compile Apache HTTP server, ensuring I enabled the worker MPM mode to enable multi-threading (a simple mistake I noticed when I saw the config summary included the old prefork MPM).</p>
<p>My configure command was as follows:</p>
<pre>./configure --enable-modules=all --enable-mods-shared=all --with-mpm=worker</pre>
<p>This went along very well.  My next step was to compile MySQL, as I needed access to the client library in order to compile PHP with support for the database backend.  Note that the coming of <a title="Introduction to PHP 5.3 Slides by Ilia Alshanetsky" href="http://ilia.ws/archives/187-Introduction-to-PHP-5.3-Slides.html">PHP 5.3</a> should obviate this as it will feature a <a title="PHP MYSQLND" href="http://forge.mysql.com/wiki/PHP_MYSQLND">native MySQL driver for PHP</a> which shares the same license as PHP, which sparked the whole problem of the <a title="PHP FAQ entry &quot; PHP 5 no longer bundles MySQL client libraries, what does this mean to me? Can I still use MySQL with PHP? I try to use MySQL and get &quot;function undefined&quot; errors, what gives?&quot;" href="http://my.php.net/manual/en/faq.databases.php#faq.databases.mysql.php5">separation between PHP the MySQL client library</a>.</p>
<p>Before I show the MySQL configure command, let me present the PHP one:</p>
<pre>./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-zlib --with-bz2 --enable-mbstring --with-mysqli --with-pdo-mysql --enable-zip</pre>
<p>This is a pretty basic PHP configuration script, rather slim, but sufficient for what I needed.  However, the configure script complained about a missing library for MySQL named &#8220;libmysqlclient_r&#8221;.  I looked for it on my system, and while I found it, it was the wrong version.  This is when I realizzed that I had to enable the thread-safe client in MySQL.  So, I did this, using this configure command:</p>
<pre>./configure --enable-thread-safe-client</pre>
<p>After a rather lengthy make &amp; make install process, PHP was <em>still</em> complaining.  I looked for libmysqlclient_r and found it, but PHP still kept complaining that it wasn&#8217;t under &#8220;/usr/local&#8221;.  It didn&#8217;t matter that I explicitly instructed it to look at the install directory of my MySQL installation.</p>
<p>Anyway, after spending several hours trying to figure this out by researching online and trial-and-error, I decided enough was enough, and I was going to follow PHP&#8217;s recommendation of running it under FastCGI.  However, I do not have a lot of experience getting Apache to run under FastCGI.  Morever, as I didn&#8217;t need Apache&#8217;s power &amp; flexibility for <em>Audio Islam</em>, I decided now was the time to go where I&#8217;ve wanted to go for a while &#8211; to host <em>Audio Islam</em> using <a title="lighttpd website" href="http://www.lighttpd.net/">lighttpd</a>.</p>
<p><span title="It's proper name is lower-cased 'lighttpd', so don't bug me about it!">lighttpd</span> (pronounced <em>lighty</em>) is a lightweight yet powerful HTTP server that is designed for low overhead and high performance.  Despite these goals, it still hosts a slew of features that sufficed it to be the backend for <em>Audio Islam</em>, alhamdulillaah.  Once I realized that I was going to go through with it, I stopped all my efforts at getting Apache HTTP working and focused on installing lighttpd.  Amazingly enough, I discovered that the latest stable version, 1.4.19, was already available via yum for RHEL4!  I quickly went ahead and install it and its fastcgi module.  And, a short while later, after some configuration, I had <em>Audio Islam</em> up-and-running on lighttpd!  Alhamdulillaah!  It was rather surprising to see how it worked perfectly out of the box once I redirected it to my newly-fastcgi-compiled PHP.  For reference, here&#8217;s the final configure command I used for compiling PHP to ultimately work on lighttpd:</p>
<pre>./configure --enable-fastcgi --enable-discard-path --enable-force-cgi-redirect --with-mysql --with-zlib --with-bz2 --enable-mbstring --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --enable-zip</pre>
<p>The first three arguments are from the <a title="lighttpd &amp; PHP tutorial" href="http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP#Others">lighttpd documentation</a>, and the rest are what I wanted in the first place.</p>
<p>So, there you have it! <em>Audio Islam</em> is now running on top of lighttpd, alhamdulillaah.  In shaaʾ Allaah this setup will enable the server to sail through Ramadhaan far smoother than previous years.  I guess we&#8217;ll find out in a couple of weeks, in shaaʾ Allaah.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2008/08/16/audio-islam-now-running-on-lighttpd/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My projects running on free software (and how to better integrate them)</title>
		<link>http://blog.basilgohar.com/2008/01/29/my-projects-running-on-free-software-and-how-to-better-integrate-them</link>
		<comments>http://blog.basilgohar.com/2008/01/29/my-projects-running-on-free-software-and-how-to-better-integrate-them#comments</comments>
		<pubDate>Wed, 30 Jan 2008 05:59:34 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/2008/01/29/my-projects-running-on-free-software-and-how-to-better-integrate-them/</guid>
		<description><![CDATA[Bismillaahir Rahmaanir Raheem Software that is free from proprietary restrictions (a.k.a, free-and-open-source software, which I will refer to as simply &#8220;free software&#8221; for the rest of this post) has become exceedingly important in my life for both philosophical as well as practical reasons. Not only do I truly believe free software to be inherently better [...]]]></description>
			<content:encoded><![CDATA[<p align="center"><em>Bismillaahir Rahmaanir Raheem</em></p>
<p align="left">Software that is free from proprietary restrictions (a.k.a, free-and-open-source software, which I will refer to as simply &#8220;<a href="http://en.wikipedia.org/wiki/Free_software" title="Wikipedia article on free software">free software</a>&#8221; for the rest of this post) has become exceedingly important in my life for both philosophical as well as practical reasons.  Not only do I truly believe free software to be inherently better in every way for humanity than proprietary/closed-source software, but I have become increasingly incapable of working with non-free software.  Now that free software solutions run the gamut of nearly everything I have a need for, I have all but eliminated non-free software from my essential stack.  Having said that, I have a special interest in web-based free software as this particular realm of software has become crucial not only to myself, but to nearly all projects in which I am involved.</p>
<p align="left"><span id="more-125"></span> Across several of my projects, most of which have yet to really take off, I have been able to fulfill all online needs using free software exclusively.  Whether it is <a href="http://wordpress.org" title="Wordpress website">WordPress</a> (<a href="http://www.columbusdawah.com" title="Columbus Dawah website">Columbus Dawah</a>, <a href="http://www.abuhurayrah.com" title="Website for Abu Hurayrah, one of the Companions of the Messenger of Allaah, salallaahu `alayhi wa sallam">AbuHurayrah.com</a>, <a href="http://www.basilgohar.com/blog" title="Personal website and blog for Basil Gohar">this site</a>), <a href="http://www.phpbb.com" title="Website for phpBB">phpBB</a> (<a href="http://forums.columbusdawah.com" title="Website for the Columbus Dawah forums">Columbus Dawah forums</a>), <a href="http://www.mediawiki.org/wiki/MediaWiki" title="Website for MediaWiki">MediaWiki</a> (<a href="http://encyclopediaislam.org" title="Website for the Encyclopedia Islam project">Encyclopedia Islam</a>), or <a href="http://moodle.org" title="Website for Moodle">Moodle</a> (<a href="http://school.columbusdawah.com" title="Website for the Columbus Dawah school">Columbus Dawah School</a>), there is a free software application ideally suited to the project&#8217;s needs.  And if one application doesn&#8217;t fit perfectly, I have the source code, so I can extend it or modify &#8211; or better yet, someone else probably already has!</p>
<p align="left">I&#8217;m currently in the planning stages of massively integrating, as much as one person can, four major pieces of online free software &#8211; WordPress, phpBB, Moodle, &amp; MediaWiki &#8211; such that they will all share the same authentication backend.  Better yet would be a way to actually &amp; truly <em>integrate</em> all four together.  While it is true that all four actually overlap somewhat with one-another (and some, like Moodle, actually have features of all the other three), I believe that each of these applications does at least one thing far better than the others.  For example, WordPress is the unmistaken champion of blogging, while phpBB (especially now that version 3.0.0 has been released as of the end of 2007) is simply outstanding for forums &amp; community sites, and nothing else comes close to what Moodle can do for an online learning environment and placing a curriculum online.   As for MediaWiki &#8211; one word &#8211; <a href="http://www.wikipedia.org/" title="Website for the Wikipedia">Wikipedia</a>.</p>
<p align="left">The goal of integrating these sites is such that I would like to build a truly cohesive community environment that utilizes the strong points from each of these separate applications, but without making my site&#8217;s visitors and project members feel like they have to deal with multiple sites.  So, one possible solution is a single sign-on for all the different applications.  There are a few different ways this could be done, either via a hack, a 3rd-party authentication system (e.g., <a href="http://openid.net/" title="Website for OpenID">OpenID</a>, <a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol" title="Wikipedia article for LDAP">LDAP</a> authentication backend), or truly integrating the different applications into one unified package.  As all the different apps have their own custom authentication systems, it is not trivial.  But, since they are free software, it&#8217;s trivial for me to actually begin such a project.  I don&#8217;t have to talk to anyone, get anyone&#8217;s permission, or work out strange and complex cross-licensing deals with myriad exceptions and/or restrictions.  This, my dear readers, is what is meant by &#8220;free as in freedom&#8221;.</p>
<p align="left">As it&#8217;s late now, I don&#8217;t want to start the tangent of actually <em>how</em> I intend to do this, as I haven&#8217;t really thought it out too much, but I am leaning heavily on an LDAP-based solution, as it is something I believe is natively supported by all four applications, and many others (should I desire to add another app to the mix &#8211; like, say, <a href="http://www.roundcube.net/" title="Website for RoundCube">Roundcube</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2008/01/29/my-projects-running-on-free-software-and-how-to-better-integrate-them/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpBB 3.0 Beta5 released</title>
		<link>http://blog.basilgohar.com/2007/01/30/phpbb-30-beta5-released</link>
		<comments>http://blog.basilgohar.com/2007/01/30/phpbb-30-beta5-released#comments</comments>
		<pubDate>Tue, 30 Jan 2007 15:39:30 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/2007/01/30/phpbb-30-beta5-released/</guid>
		<description><![CDATA[Alhamdulillaah, phpBB 3.0 Beta5 has been released! They mention in the announcement that they are anticipating the next release to be a Release Candidate, which means we may possibly have phpBB 3.0 final by this Summer, in shaa Allaah. I have been anxiously awaiting phpBB 3.0 for a loooong time (predating this blog, that&#8217;s for [...]]]></description>
			<content:encoded><![CDATA[<p>Alhamdulillaah, phpBB 3.0 Beta5 has been <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=507324" title="phpBB 3.0 Beta5 release announcement" target="_blank">released</a>!  They mention in the announcement that they are anticipating the next release to be a Release Candidate, which means we may possibly have phpBB 3.0 final by this Summer, in shaa Allaah.</p>
<p>I have been anxiously awaiting phpBB 3.0 for a <em>loooong</em> time (predating this blog, that&#8217;s for sure).  <a href="http://area51.phpbb.com/docs/features.html" title="phpBB 3.0 feature list" target="_blank">Features</a> like sub-forums, UTF-8, and others that make sense for administering a larger forum have been a long time coming, and I have to hand it to the phpBB team &#8211; it is not for slacking, they are just so darn thorough.  And they are probably dead-set on making phpBB 3.0 rock-solid in terms of performance, security, and stability, so I&#8217;m not pushing them to hurry to the final release&#8230;I just wish they would hurry to the final release.</p>
<p>My immediate need is for an upgrade for the <a href="http://forums.columbusdawah.com" title="Columbus Dawah forums" target="_blank">Columbus Dawah forums</a>, but I am reasonably sure that it won&#8217;t be the last forum I am working on, and I always prefer using a free-and-open-source alternative to proprietary and closed-source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2007/01/30/phpbb-30-beta5-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpBB 3.0 Beta3 released!!!</title>
		<link>http://blog.basilgohar.com/2006/11/13/phpbb-30-beta3-released</link>
		<comments>http://blog.basilgohar.com/2006/11/13/phpbb-30-beta3-released#comments</comments>
		<pubDate>Mon, 13 Nov 2006 19:31:50 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.basilgohar.com/blog/2006/11/13/phpbb-30-beta3-released/</guid>
		<description><![CDATA[Alhamdulillaah, the final release of phpBB3 approaches ever nearer with the release of Beta3. I&#8217;ve always been an avid phpBB fan, and although I was the friendly admin of a vBulletin 3-powered forum for well over a year, phpBB has always been my choice when it came to deploying my own bulletin board sites for [...]]]></description>
			<content:encoded><![CDATA[<p>Alhamdulillaah, the final release of phpBB3 approaches ever nearer with the <a title="phpBB 3.0 Beta3 released" href="http://www.phpbb.com/phpBB/viewtopic.php?t=470468">release of Beta3</a>.  I&#8217;ve always been an avid <a title="phpBB website" href="http://www.phpbb.com/">phpBB</a> fan, and although I was the <a title="Member page for Abu Hurayrah" href="http://forums.almaghrib.org/member.php?u=3">friendly admin</a> of a <a title="AlMaghrib Institute student forums" href="http://forums.almaghrib.org/">vBulletin 3-powered forum</a> for well over a year, phpBB has always been my choice when it came to deploying <a title="Columbus Dawah forums" href="http://forums.columbusdawah.com/">my own bulletin board sites</a> for its <a title="phpBB license page" href="http://www.phpbb.com/support/license.php">free-and-open-source</a> philosophy and generally high-quality nature (despite a surge of security breaches a short while back).<span id="more-77"></span></p>
<p>What&#8217;s even better is that Beta3 brings a <em>major</em> change of complete UTF-8 support!  Joy of joy!  It&#8217;s getting more-and-more ridiculous how so many sites are beyond-ASCII unfriendly, and seeing the team at phpBB make this bold decision is very encouraging, and it is a positive sign that the few lingering open-source projects that are holding out going to be likewise folding soon.  No doubt, the Unicode support in PHP 6 will definitely provide a positive boost in this direction for the various PHP-based projects out there, but if PHP 5 adoption rate is any sign, I estimate that <a title="PHP 6 meeting notes" href="http://www.php.net/~derick/meeting-notes.html">PHP 6</a> may not achieve wide adoption until sometime after the <a title="Wikipedia article for 'Sun'" href="http://en.wikipedia.org/wiki/Sun">Sun</a> goes <a title="Wikipedia article for 'Nova'" href="http://en.wikipedia.org/wiki/Nova">nova</a>.</p>
<p>However, being an early adopter, I&#8217;m sure I&#8217;ll have plenty of time to work with it before I have to whip-out the sunscreen, in shaa Allaah!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2006/11/13/phpbb-30-beta3-released/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Server, Apache HTTPD, PHP, &amp; Subversion source configuration &amp; installation</title>
		<link>http://blog.basilgohar.com/2006/05/27/mysql-server-apache-httpd-php-subversion-source-configuration-installation</link>
		<comments>http://blog.basilgohar.com/2006/05/27/mysql-server-apache-httpd-php-subversion-source-configuration-installation#comments</comments>
		<pubDate>Sat, 27 May 2006 21:37:23 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://tech.hidayahonline.org/2006/05/27/mysql-server-apache-httpd-php-subversion-source-configuration-installation/</guid>
		<description><![CDATA[I have my webserver (at the time of this writing, the one on which this blog is posted) configured rather nicely, however, as with everything that accumulates over time, it&#8217;s current state is a combination of quite a lot of trial-&#038;-error sessions that would be really hard to duplicate the first time I tried to [...]]]></description>
			<content:encoded><![CDATA[<p>I have my webserver (at the time of this writing, the one on which this blog is posted) configured rather nicely, however, as with everything that accumulates over time, it&#8217;s current state is a combination of quite a lot of trial-&#038;-error sessions that would be really hard to duplicate the first time I tried to do so on another environment.  Therefore, I&#8217;m going to try to log the configuration I use to get a system working as I like.  This may or may not turn into a tutorial-type series, but for now, it&#8217;s just notes for myself.<span id="more-36"></span></p>
<p>The core of my server is, of course, the Apache HTTPD web server.  For dynamic pages, I almost entirely rely on the PHP programming language.  For database storage, I use MySQL.  Finally, rounding out the most important services I run on my server is Subversion versioning server, which I use for nearly all my code-based projects now.  I also run the IceCast2 server, but since its configuration is pretty-much independent of the other four packages I&#8217;ve described, I&#8217;ll leave that out for the time being.</p>
<p>I strongly prefer source-based installations for the flexibility you get when it comes time to install.  With the advent of a large support community around the Fedora project, it&#8217;s really become less of any issue, as nearly every package is kept up to date with the latest version.  This is good &#038; well for my development machine at home.  But my current host, Servermatrix, only supports Redhat Enterprise Server releases.  Therefore, to get the latest versions of these server packages, I will need to go to the sources.  Plus, you get to learn a <em>lot</em> more when you&#8217;re getting down-&#038;-dirty with the code &#8211; configuring, compiling, and sometimes every altering code!  Oh&#8230;the excitement!</p>
<p>Having said that, this configuration guide is going to be dealing with the source-based installations of these packages only.  So, let&#8217;s start downloading.  Here are the relevant links (I have tried to link to the most specific, version-neutral download page available for each package):</p>
<ul>
<li><a title="MySQL downloads page" href="http://dev.mysql.com/downloads/">MySQL Server</a></li>
<li><a title="Apache HTTPD downloads page" href="http://httpd.apache.org/download.cgi">Apache web server</a></li>
<li><a title="PHP downloads page" href="http://us3.php.net/downloads.php">PHP</a></li>
<li><a title="Subversion packages page" href="http://subversion.tigris.org/project_packages.html">Subversion</a></li>
</ul>
<p>I strongly suggest you make a directory named &#8220;packages&#8221; or something unambigious in which to download &#038; extract all your files.  This is the way <em>I</em> do it, and it&#8217;s the way I&#8217;ll be doing it throughout this guide.  How <em>you</em> do it is your business, but I can&#8217;t possibly know for sure how you&#8217;ll be doing it ahead of time.  If you have a preferred, possibly <em>superior</em> package directory structure, by all means, do post a comment or let me know some other way.  I&#8217;m always up for doing things the <em>better</em> way, if &#038; when I discover such ways.  However, I&#8217;ll be referring to the packages directory throughout this guide, so now you know to what I&#8217;ll be referring.<br />
While you&#8217;re downloading these packages, now would probably be a good time to start reading up on the documentation for each package. Some more nice links to check out (I have linked to either the most updated documentation available online or, where appropriate, to the documentation related to the specific version covered by this guide):</p>
<ul>
<li><a title="MySQL Server 5.0 online documentation" href="http://dev.mysql.com/doc/refman/5.0/en/index.html">MySQL documentation</a></li>
<li><a title="Apache HTTPD 2.2 online documentation" href="http://httpd.apache.org/docs/2.2/">Apache HTTPD documentation</a></li>
<li><a title="PHP online documentation" href="http://www.php.net/manual/en/">PHP documentation</a></li>
<li><a title="Subversion " href="http://svnbook.red-bean.com/nightly/en/index.html">Subversion documentation (SVN book)</a></li>
</ul>
<p>It&#8217;s probably a good idea to bookmark these pages.  If you&#8217;re using a browser that supports tabs (e.g., Firefox), you might consider making a folder with just these relevant links.  You&#8217;ll probably appreciate it multiple times throughout this guide.</p>
<p>Once you&#8217;re downloads have all finished, it&#8217;s time to start extracting!  I usually download the bzip2 versions of each package, if they are available, because I like the idea of things taking less space where possible.  With modern CPUs, the time difference between gzip compression &#038; bzip2 compression is almost a non-issue, whereas the space savings almost always is significant (10 &#8211; 20% minimum, usually).  At a later date I will probably go into more details about how the packages are structured, but for now, I&#8217;ll just explain how to get the files out &#038; ready to configure.  The command to extract the files will look like the following:</p>
<p>For bzip2-compressed packages:</p>
<pre>tar -xf package-name-version.tar.bz2 --bzip2</pre>
<p>For gzip-compressed packages:</p>
<pre>tar -xf package-name-version.tar.gz --gzip</pre>
<p>This will usually extract out the files into a subdirectory like this:</p>
<pre>~/packages/package-name-version</pre>
<p>This will become important as we do upgrades to newer versions.  As you extract the new versions to their respective directories, you generally won&#8217;t overwrite your older versions.  This is very useful, as you&#8217;ll be able to go to your older versions &#038; retrieve your old configuration settings nearly effortlessly, which will save a lot of time when it comes time configure, compile, &#038; install a newer version of an existing package.</p>
<p>So, once we&#8217;re done, we should have four files in ~/packages and four directories with names similar to the packages.  We&#8217;ll stop here &#038; proceed forward with another session when I&#8217;m feeling up to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2006/05/27/mysql-server-apache-httpd-php-subversion-source-configuration-installation/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP, PEAR, &amp; Zend Framework coding standards</title>
		<link>http://blog.basilgohar.com/2006/04/29/php-pear-zend-framework-coding-standards</link>
		<comments>http://blog.basilgohar.com/2006/04/29/php-pear-zend-framework-coding-standards#comments</comments>
		<pubDate>Sat, 29 Apr 2006 14:54:33 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tech.hidayahonline.org/2006/04/29/php-pear-zend-framework-coding-standards/</guid>
		<description><![CDATA[I&#8217;m all for standardization and standardizing procedures for long-term efficiency. However, up until now, where there were no &#8220;official&#8221; standards for something, I would make up my own or imitate what I thought was the nicest. One place where I&#8217;ve done just this was with regards to my coding styles for PHP &#8211; I had [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m all for standardization and standardizing procedures for long-term efficiency.  However, up until now, where there were no &#8220;official&#8221; standards for something, I would make up my own or imitate what I thought was the nicest.  One place where I&#8217;ve done just this was with regards to my coding styles for PHP &#8211; I had my own styles.  Well, no more!  I&#8217;ve finally decided to take the plunge and following the <a title="PEAR website" href="http://pear.php.net">PEAR</a> <a title="PEAR coding standards" href="http://pear.php.net/manual/en/standards.php">coding standards</a>.<span id="more-27"></span></p>
<p>The most obvious &#038; immediate advantage of this is that my code will have a uniform look &#038; feel to it throughout &#8211; whether at home, online, or at work.  Another important, though less immediate benefit is that I will be able to contribute my code into the PEAR collection should I choose to do so.  Moreover, it would seem that PEAR is easily going to be the biggest player towards the standardization of PHP programming styles (with a possible exception being the <a title="Zend Framework website" href="http://framework.zend.com">Zend Framework</a> <a title="Zend Framework coding standards" href="http://framework.zend.com/manual/en/coding-standard.coding-style.html">coding standards</a> which, at first glance, seem to be inline with those of PEAR).  The Zend Framework standards go a bit further &#038; attempt to dictate how your should actually be <em>coding</em> &#8211; and it would seem that their guidelines are reasonable &#038; logical from a cursory glance.<br />
I&#8217;ve already started converting the <em>style</em> of my codebase for <a title="Hidayah Online website" href="http://hidayahonline.org">Hidayah Online</a>, however, the code is not yet completely PEAR-compliant.  The added benefit of going through all my codebase is that I am also able to trim it quite significantly &#8211; I have a habit of commenting-out code that I no longer want to use, and this habit over time has resulted in rather bloated files.  I have been able to trim a large portion of these whilst also removing files that were never used in the first place.  In addition, I have removed several unused or deprecated functions, classes, and miscellaneous code that just doesn&#8217;t need to be there anymore.  This exercise will really help to make the project more manageable and move from the hodgepodge of nearly unrelated scripts into an actual uniform application.</p>
<p>I&#8217;ll try to follow this up with a more analytical commentary on the PEAR &#038; Zend Framework standards, including contrasting it with my own coding style as well as trying to discover if there are any conflicts between the two styles.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2006/04/29/php-pear-zend-framework-coding-standards/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing PHP Iterators &#8211; The Beginning</title>
		<link>http://blog.basilgohar.com/2006/04/07/implementing-php-iterators-the-beginning</link>
		<comments>http://blog.basilgohar.com/2006/04/07/implementing-php-iterators-the-beginning#comments</comments>
		<pubDate>Fri, 07 Apr 2006 15:48:00 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://tech.hidayahonline.org/2006/04/07/implementing-php-iterators-the-beginning/</guid>
		<description><![CDATA[One of the new features that came with PHP 5 is the ability to implement Iterators. Implementing one of your objects as an iterator essentially allows you to treat it as a standard array. By default, without adding any additional code, you can enable iteration over a regular objects variable members. So, for example, if [...]]]></description>
			<content:encoded><![CDATA[<p>One of the new features that came with <a href="http://www.php.net/zend-engine-2.php" title="PHP 5/Zend Engine 2 features">PHP 5</a> is the ability to implement <a href="http://us3.php.net/manual/en/language.oop5.iterations.php" title="PHP Iterators page"><span style="font-style: italic">Iterators</span></a>.  Implementing one of your objects as an iterator essentially allows you to treat it as a standard array.  By default, without adding any additional code, you can enable iteration over a regular objects variable members.  So, for example, if I had the following code:</p>
<p>(I&#8217;ve removed the plugin that I used to format PHP code here, so until I find out that works, I apologize for not showing my code examples&#8230;)<br />
If I were to run a foreach() loop over this, I would get behavior that would correspond to an array with the elements of $bar1, $bar2, &amp; $bar3.  This is wonderful default functionality.  However, you can go a step further if you want to implement more complex &amp; complete behavior.  I&#8217;m going to be experimenting on this kind of behavior with my DBObject class &#8211; namely, converting it to a DBArray object, and see how well that goes over.  I will report on my successes &amp; travails in followup posts.</p>
<p>(<em>Boy</em> I&#8217;m having a hard time to get WordPress to format code on this thing&#8230;probably need to get an extension to do it.  Any suggestions?)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2006/04/07/implementing-php-iterators-the-beginning/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Framework</title>
		<link>http://blog.basilgohar.com/2006/03/14/zend-framework</link>
		<comments>http://blog.basilgohar.com/2006/03/14/zend-framework#comments</comments>
		<pubDate>Tue, 14 Mar 2006 17:14:20 +0000</pubDate>
		<dc:creator>Basil</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tech.hidayahonline.org/2006/03/14/zend-framework/</guid>
		<description><![CDATA[My supervisor brought to my attention the Zend Framework &#8211; an interesting PHP-powered answer to Ruby-on-Rails.  The Zend Framework seems to espouse the MVC design pattern.  It looks really interesting &#038; is worth another look here shortly.  I&#8217;ll follow-up &#038; let you know what I find out.]]></description>
			<content:encoded><![CDATA[<p>My supervisor brought to my attention the <a title="Zend Framework site" href="http://framework.zend.com/">Zend Framework</a> &#8211; an interesting <a title="PHP homepage" href="http://www.php.net">PHP</a>-powered answer to <a title="Ruby on Rails site" href="http://www.rubyonrails.org/">Ruby-on-Rails</a>.  The Zend Framework seems to espouse the <a title="Wikipedia entry for Model-view-controller" href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> design pattern.  It looks really interesting &#038; is worth another look here shortly.  I&#8217;ll follow-up &#038; let you know what I find out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.basilgohar.com/2006/03/14/zend-framework/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

