<?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>Jacob Santos &#187; PHP</title>
	<atom:link href="http://jacobsantos.com/tags/php-related/feed/" rel="self" type="application/rss+xml" />
	<link>http://jacobsantos.com</link>
	<description>Rumblings, rants, essays, stories by Jacob Santos about Web Site Development, Persistent Browser-Based Games, personal journal, and Programming.</description>
	<lastBuildDate>Fri, 03 Feb 2012 01:06:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3-aortic-dissection</generator>
		<item>
		<title>Contemplation of Plugin Models</title>
		<link>http://jacobsantos.com/2008/general/contemplation-of-plugin-models/</link>
		<comments>http://jacobsantos.com/2008/general/contemplation-of-plugin-models/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 01:12:49 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/?p=439</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2008/general/contemplation-of-plugin-models/" title="Contemplation of Plugin Models"></a>Adapter Class Pattern The advantages lies in knowing the inner architecture of the classes. I can extend the system with minimal documentation, but an outsider would require more details. I can&#8217;t give out any packages since I very much find &#8230;<p class="read-more"><a href="http://jacobsantos.com/2008/general/contemplation-of-plugin-models/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2008/general/contemplation-of-plugin-models/" title="Contemplation of Plugin Models"></a><h3>Adapter Class Pattern</h3>
<p>The advantages lies in knowing the inner architecture of the classes. I can extend the system with minimal documentation, but an outsider would require more details.</p>
<p>I can&#8217;t give out any packages since I very much find anything I use extremely useful. The entire point, is that with enough time, everything makes sense. If I don&#8217;t have much time, I want a quick as possible fix that does what I need. If I did not code the package, then I have no idea where to begin (even after reading the documentation, if it is detailed enough).</p>
<p>My first prototype was this, a class would extend a base abstract class which would offer methods for allowing other classes to plug into that class. The child class would then call those &#8220;plugins&#8221; when needed. It would work fine, but I felt that the finished design would still be flawed, so I never finished it.</p>
<h3>&#8220;WordPress&#8221; Model</h3>
<p>I use WordPress, since I work most with it, but I found it within other web applications. I laughed at what I thought was a poor design when I first looked at the code. I think that after using it for a while, that its ease and speed to get plugins functional really appeals to me.</p>
<p>It is a wonderful implementation to allow for hooking into systems by such a simple method. A simple method that does not require knowing which class or function will use it. Only knowing the hook name and the parameters that will be passed (also, which function to use).</p>
<pre class="brush: php; title: ;">
function myAction()
{
    // Do stuff
}

add_action('some_hook', 'myAction');
</pre>
<p>WordPress combines all of the hooks into a single global variable. The code is something, but it works by using call_user_func() and storing the second parameter in add_action or add_filter functions. It is placed in an array with the first parameter name. That way, any number of functions or methods can be run without overwriting any others. There are other mechanisms, but the code exists, so enjoy.</p>
<h3>Pluggable Plugin Model</h3>
<p>The idea has been wandering around, but I feel the best way to solve my issue is to code it and see what happens. Some of the prototype is in Quantum Game Library in some form of TDD.</p>
<p>I think where I lose faith is with the Singleton model. However, I&#8217;m debating whether it wouldn&#8217;t be the best way to do it. How else would you pull in the plugin model without using a function or Global to hold the class?</p>
<p><strong>Adding a Hook Type</strong></p>
<p>The hook type controls what happens when different methods are called. This is to create a uniform structure for all hook types and still allow for custom control for those special cases where database queries are needed.</p>
<p>In most cases a generic class can be used, in that case then I think the base module structure should be like so. The first example is for custom hook objects and the second is for using the generic hook object.</p>
<pre class="brush: php; title: ;">
// Example 1
MyPlugin::getInstance()-&gt;register('mycustomhook', new MyPlugin_Module_Hook);

// Example 2
MyPlugin::getInstance()-&gt;register('myhook');
</pre>
<p><strong>Adding a Hook to the Hook Type</strong></p>
<p>I really think it would make sense to use __call() magic method for calling the objects. This would abstract the class structure to allow for changes to not affect the code that calls it. The __call() would use the first parameter in the register method.</p>
<pre class="brush: php; title: ;">
function myAction()
{

}

MyPlugin::getInstance()-&gt;myhook('some_hook')-&gt;add('myAction');
</pre>
<p><strong>Chaining</strong></p>
<p>Adding multiple modules:</p>
<pre class="brush: php; title: ;">
MyPlugin::getInstance()-&gt;register('action')
                                -&gt;register('filter')
                                -&gt;register('options', new Custom_Module_Options);
</pre>
<p>Adding multiple hooks:</p>
<pre class="brush: php; title: ;">
MyPlugin::getInstance()-&gt;action('some_hook')-&gt;add('myAction')-&gt;priority(10)
                                -&gt;action('some_hook')-&gt;add('myAction')-&gt;priority(5);
</pre>
<p>Calling a hook:</p>
<pre class="brush: php; title: ;">
MyPlugin::getInstance()-&gt;action('some_hook')-&gt;call();
</pre>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2008/general/contemplation-of-plugin-models/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will Documentation Writers Be Remembered?</title>
		<link>http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/</link>
		<comments>http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 22:36:34 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[Documentation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://www.santosj.name/programming/php-related/will-documentation-writers-be-remembered/</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/" title="Will Documentation Writers Be Remembered?"></a>Probably not. I think the ends far outweigh the perceived gains from being &#8220;recognized.&#8221; One of the major advantages of PHP is its heavily documented functions and its almost one stop shop for finding everything you&#8217;ll need and want to &#8230;<p class="read-more"><a href="http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/" title="Will Documentation Writers Be Remembered?"></a><p>Probably not. I think the ends far outweigh the perceived gains from being &#8220;recognized.&#8221; One of the major advantages of PHP is its heavily documented functions and its almost one stop shop for finding everything you&#8217;ll need and want to know about a function. I don&#8217;t know who those people are, but I have a lot of love for the time and energy they put in.</p>
<p>It is possible to find their names, but I don&#8217;t think many would put in the energy. Coincidently, not many will put in the effort to document a project. It just takes too much sweat, blood, and tears.</p>
<p>It is rewarding in the metaphorical sense, and if you have to pay penitence for not documenting past projects. Documenting another&#8217;s project is one way to avoid the whip. It is actually relaxing, in the sense that I can spend hours, &#8220;Holy crap, it is 3am already? Just a few more hours and then I&#8217;ll go to bed.&#8221;</p>
<p>The project I&#8217;m currently documenting probably be the same. People may thank me without knowing my name, but you know I won&#8217;t mind. If only to make up for past mistakes and learn new habits that will better benefit future ones. The reward for me, is the knowledge gained from the insight and from that I think I&#8217;m doing myself more good. It is how I can justify non sexy work, such as documentation.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2007/general/will-documentation-writers-be-remembered/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I was wrong about phpBB</title>
		<link>http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/</link>
		<comments>http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/#comments</comments>
		<pubDate>Wed, 06 Jun 2007 00:21:10 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/programming/php-related/i-was-wrong-about-phpbb/</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/" title="I was wrong about phpBB"></a>It seems that several people and their comments were correct about several problems with my posting. Okay, it might have been the wrong post, but regardless, I do regret writing the phpBB is dead&#8230; post. I had meant for it &#8230;<p class="read-more"><a href="http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/" title="I was wrong about phpBB"></a><p>It seems that several people and their comments were correct about several problems with my posting. Okay, it might have been the wrong post, but regardless, I do regret writing the <a href="http://jacobsantos.com/programming/php-related/php/phpbb-is-dead-long-live-fudforum-or-at-least-smf/">phpBB is dead&#8230;</a> post. I had meant for it to be more about how quickly I was able to implement a user transfer script using the <a href="http://fudforum.org">FUDforum</a> API. I have a problem with going off on tangents and of making an ass of myself. </p>
<p>Luckily, it is usually outside the confines of a publicly accessible blog with my name on it. I&#8217;m learning that perhaps writing posts a certain way, when my name is displayed, isn&#8217;t such a good idea. I have been planning for creating a <a href="http://www.wordpress.com">WordPress.com</a> blog that just has short stories in the horror genre and discuss different ways of killing people and random thoughts about murder. You know, posts that would bring the cops to my front steps. </p>
<p>However, placing my name on such a blog would seriously restrict me on what jobs I would be able to get. I don&#8217;t want a potential employer finding one of my murder posts and say, &#8220;Yeah, the last thing we need is someone shooting up this place!&#8221; I will never do that, but the last thing I need is for the perspective to be that I would.</p>
<p>The same could be said about posts that have my head up my ass. I need to stop writing posts that put my head up my ass or at least not put them on this blog.</p>
<h3>Open Source: Adding it Yourself</h3>
<p>Another point that needs to be made in open source development is that, if some application doesn&#8217;t have a feature, instead of bitching, add it yourself. WordPress doesn&#8217;t have XYZ, so what? Add X and see if anyone else has done Y or Z. If not, start it and see if anyone would improve on your work.</p>
<p>The <a href="http://sessions.visitmix.com/default.asp?event=1015&#038;session=2015&#038;pid=PAN07&#038;disc=&#038;id=1540&#038;year=2007&#038;search=PAN07">MIX panel</a> <a href="http://netevil.org">Wez Furlong</a> was on, said it best and I&#8217;m paraphrasing, &#8220;Usually, I can find a script that does about half of what I need and I can add the rest.&#8221;</p>
<p>Would it be worth your time to take a script and spend a week adding in Feature X or spend two or more years writing the whole script in some cases?</p>
<p>I think I get so caught up in that web applications should be free and do everything I want. Add it myself? No way buddy, I don&#8217;t have time for that! Yet, I spent two months on a piece of crap front controller and mini-Zend Framework (before I knew of Zend Framework) Framework. Okay, why not use Ez Components or Solar or Cake?</p>
<p>I&#8217;ve thought of using the backend of WordPress, the API, for other projects. Recreate a system that does comments, manage posts, and does everything WordPress does? Why waste the time? I could be doing more productive tasks, like improving the WordPress backend and add the features I want to it and submitting the patches back to WordPress team. Hell, they might even like the patch (unlikely).</p>
<p>Too much time is spent reinventing something and not enough time inventing something that <a href="http://www.websnapr.com">no one else has</a>. Going forward, I&#8217;m going to reprogram myself to reuse scripts.</p>
<h3>phpBB 3 Release Candidate</h3>
<p>Some of the features are way beyond what I could implement. The installer looks kick ass. The team has it <a href="http://blog.phpbb.cc/articles/into-phpbb/">together based on the comments</a> of someone on the development team. I do still wish that they had it out two years ago, but at this point, I&#8217;m just happy that it is still free. </p>
<p>Hopefully it doesn&#8217;t take as long for 3.2, but I think I should help out and do my part if that is the case.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2007/general/i-was-wrong-about-phpbb/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PHP is turning into the Classic ASP</title>
		<link>http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/</link>
		<comments>http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 20:30:32 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/programming/php-related/php-is-turning-into-the-classic-asp/</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/" title="PHP is turning into the Classic ASP"></a>I was going over the Internals of the PHP developers and I really think that there needs to be a change in perspective on which features should be part of PHP. If it is up to vote, then put it &#8230;<p class="read-more"><a href="http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/" title="PHP is turning into the Classic ASP"></a><p>I was going over the Internals of the PHP developers and I really think that there needs to be a change in perspective on which features should be part of PHP. If it is up to vote, then put it up to vote for the majority of PHP developers. Those who develop in PHP and those who develop PHP. Why place such importance and decision on those who only write to the Internals mailing list? Reading the weekly reviews and Past Year reviews has bought up some really interesting features for PHP that were tossed out because either it was buggy or because more people voted it down than up. It appears that for any feature to gain support it needs (1) to have an already working implementation for everyone to test and look at and (2) support from the majority of the leaders and internal developers.</p>
<p>Doesn&#8217;t matter that (1) it is such a great feature that some PHP developers would look on it as an improvement over other workarounds or (2) that it would help gain further support in the outside community. </p>
<p>The machinery behind PHP has a certain perception of PHP. </p>
<ol>
<li>That PHP should only be used for quick (in their opinion) and maintainable web development and the features supported should complement that.</li>
<li>That if you need speed, you should development PHP extensions.</li>
<li>That if you need other syntax or features in other languages, you should use those other languages.</li>
</ol>
<p>I know about the third point and people should learn other languages and use the best one. It seems reluctant on the part of the PHP developers to look aside from that many would rather use the other languages that offers better support for features and stay away altogether from PHP. PHP is becoming the classic ASP.</p>
<p>The reason I switched to PHP is because more importantly it was free and had a lot of free features that you had to pay for to use in ASP. There is almost no reason to use PHP, since the new ASP.NET is in my opinion better. I&#8217;m really debating learning C# and will probably do so over the Summer. Python is also looking damn sexy at this point and Ruby in some aspects, but I&#8217;ll rather learn Python over Ruby.</p>
<p>PHP is also losing a lot of great developers that use the language, gaining dissension from its current developers using PHP. Any language should look to security experts as Gods and worship the ground they walk on. I would kiss the ass of any security expert, just because they are elite. Anyone can program and develop awesome applications for OS and the web, but it takes a real expert to do security and know it well. When they leave, there will no longer be any advantage of using PHP and would be time to learn another language. ASP.NET I&#8217;m coming a knocking. </p>
<p>Really, I say this, but I&#8217;m unimportant. No one would miss me if I left. I suppose, but what about the rest of the developers using PHP? What if they left? Are they also not important? I doubt it. Like security experts, I would also kiss the ground of the users of my application. Without them, the product is nothing. </p>
<p>ASP.NET project to add support for PHP should be making PHP developers afraid. Holy shit! We have to be adding new features before we lose more users. If you can transition between two languages, many companies that have large applications in one language can do so. To switch between PHP to C# or VB.NET with ease and low cost overhead.</p>
<h3>My Suggestion</h3>
<p>Recreate the PHP Engine and start anew. Pull an ASP and refactor the engine with new features and keep the ease of development for extensions. Screw backwards compatibility and use a new name. PHPvolution Engine 1 or something less crappy. The only issue is that it would require the support of the Rasmus and the rest of the PHP maintainers for it to include PHP in the name. Revolution Engine for PHP would work, if &#8220;Revolution&#8221; wasn&#8217;t used already.</p>
<p>It is radical, and yes would require either a lot of developers or a lot of time to finish. Why not start now? I just wish I knew more about compiler theory with many years of experience. I won&#8217;t be able to gather enough support for a team that would keep together to completion. The current team isn&#8217;t going to do anything. Zend Engine 3? Doubtful for any number of years.</p>
<p>If something isn&#8217;t done soon, then more and more coders using PHP will move on to Ruby and Python and PHP will become the new Perl. I can hear it now, &#8220;What ever happen to PHP?&#8221; or &#8220;Pfft, no one programs in PHP anymore!&#8221; or &#8220;Man, I had to maintain legacy PHP application!&#8221;</p>
<h3>Should I stay or should I go</h3>
<p>I&#8217;ve been asking myself for a long time. I can either try my hardest to improve PHP by building my own compiler or I can give up and learn another language. I should do that anyway. I&#8217;m competent enough (or so I think) developing in PHP that it should be time to move on to learning another language. I can apply what I know to that other language and quickly learn its syntax, gotchas, and rules. </p>
<p>The goal is to hide the difficulty of developing using the features. It is possible to create link lists and trees using the PHP array, but it requires thinking outside the box and will have some gotchas doing so. If PHP already had a LinkList object it would hide how it was done from the user and allow the user to focus only on using it. The solutions are allowing the developer to use &#8220;advanced&#8221; language features to speed development and bring ease of developing in PHP. Classes weren&#8217;t added because &#8220;&#8230;they are nice to have.&#8221; They were added to abstract away the difficulty of using functions and global variables in such a way to create a similar effect. Objects are possible in C, but if you knew how difficult to read it was, you probably would never do so. The code to create an object in C++ is much better looking and easier to maintain than C objects.</p>
<p>Languages need to hide difficulties of development away from the developer to speed development. Just because it &#8220;looks&#8221; like another language does not necessarily make it bad or &#8220;not the PHP way.&#8221; There is no &#8220;PHP way&#8221; of doing things, either the feature is used or it isn&#8217;t used, either it is desired or it is not desired, either it is easy to use or it isn&#8217;t easy to use. It could be argued that Classes are in no way easy to use, but objects are somewhat of an advanced study anyway. JavaScript does a very nice job of abstracting objects from the developer and making it easier to use and develop them. The syntax might be a little funny looking, but I like it a lot better than some other languages.</p>
<p>I think PHP is worth it to build a new compiler and spend the years doing so. If I spend enough time and support enough of PHP features and extensions, I should be able to gather a team to further improve it. Two years isn&#8217;t going to push developers of PHP away and in that time PHP should had introduced better language features and extensions.</p>
<h3>What is the problem again?</h3>
<p>I should clarify my problem with the Internals. To often this statement appears, &#8220;It looks too much like XYZ language.&#8221;</p>
<p>Questions to ask when thinking about adding a new feature:</p>
<ol>
<li>What problem of the language produced the desire?</li>
<li>What solution does it offer that wasn&#8217;t available before?</li>
<li>Can the same desired result be accomplished in another way?</li>
<li>What other problems (gotchas) will be introduced with the feature?</li>
<li>Will the feature introduce a solution for something that was missing and be beneficial to the majority of developers?</li>
<li>How will it speed development for the developers using it?</li>
</ol>
<p><strong>Example with Namespaces:</strong></p>
<ol>
<li>Not naming prepending their functions and classes correctly causing naming conflicts.
<ul>
<li>Using myfunc() instead of myProject_myFunc()</li>
<li>Using myClass { } instead of myProject_myClass { }</li>
<li>Using Iterator { } instead of myProject_myClass_Iterator { }</li>
</ul>
</li>
<li>Namespaces would offer saving a few key strokes of long class names because of the lack of namespaces. Instead of having to type or copying/pasting myProject_MainClass_Subclass_Subclass_Subclass throughout the code base, it would shorten to in most places to just &#8220;SubClass&#8221; from within the myProject_MainClass_Subclass_Subclass namespace. I would no longer have to refer to the classes in their full form, saving typing and having to go through and renaming when I changed the upper namespace to another name.
<pre class="brush: php; title: ;">
namespace myProject
{
    private class Worker
    {

    }

    class Factory
    {
        static public function factory()
        {
            return new Worker();
        }
    }

    namespace Worker
    {
        // Here the :::Iterator access the top level
        // php namespace for the SPL Iterator class.
        class Iterator extends :::Iterator
        {

        }
    }
}
</pre>
</li>
<li>Yes, see above. It is possible with proper naming to accomplish the same result, albeit with more typing.</li>
<li>It will introduce some issues with the top level namespaces and how developers will interact with it. In my example, I used &#8216;:::&#8217; to access the default PHP namespace for which the STL Iterator object is in. However, STL could use its own namespace for when namespaces are added and the example would be &#8216;STL:::Iterator&#8217; instead.</li>
<li>It would be able to introduce private or internal classes to PHP and control the flow of objects. You&#8217;ll sometimes want to pass around objects or have functions that you don&#8217;t want the user to play with or should play with. It would be beneficial to save typing for objects in the same namespace.</li>
<li>It would speed development by allowing developers to use any name they want within their own namespace, as well as saving typing, and going through and renaming complete objects whenever a the namespace name changes. If I wanted to change Quantum_Coordinate_Array and Quantum_Coordinate_Boundary to Quantum_Vector_Array and Quantum_Vector_Boundary, I wouldn&#8217;t need to go through and change each class. Also, IDEs would be able to make the namespace name changes for the developer because it would know about the namespaces and be able to tell when the namespace name changed.</li>
</ol>
<p>What other language features can be debated using this list or a better one? Don&#8217;t tell me it isn&#8217;t &#8220;PHP&#8217;s way&#8221; or that I want it just because it will be &#8220;nice to have.&#8221; I want it because it would make my development projects easier to create and maintain. </p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2007/general/php-is-turning-into-the-classic-asp/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Story Time: Register Globals WTF</title>
		<link>http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/</link>
		<comments>http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/#comments</comments>
		<pubDate>Sun, 08 Oct 2006 22:42:53 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/php/story-time-register-globals-wtf/</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/" title="Story Time: Register Globals WTF"></a>Once upon a time&#8230; ah I&#8217;m kidding, it was a little over a year ago to date. This is just another post in the saga as to why I hated working on a certain browser game. I was just thinking &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/" title="Story Time: Register Globals WTF"></a><p>Once upon a time&#8230; ah I&#8217;m kidding, it was a little over a year ago to date. This is just another post in the saga as to why I hated working on a certain browser game. I was just thinking about why removing the Register Globals in PHP 6 is going to be so awesome.</p>
<h3>Where does this variable get its data?</h3>
<p><strong>Me:</strong> What is this one variable? Named $action. Is it from a form or the URL?<br />
<strong>The Original Coder:</strong> I have no idea!</p>
<p>As usual, there aren&#8217;t any comments as to where the data came from. So yeah, a little bit of work and testing usually leads to the answer. Afterwards, it means updating the variable to using the correct super global. In which case, it meant updating 20-30 pages. Total time waster, since it shouldn&#8217;t have been needed in the first place.</p>
<p><span id="more-314"></span></p>
<h3>Doesn&#8217;t work on PHP 5, so what?</h3>
<p><strong>Me:</strong> The current code doesn&#8217;t work on PHP 5!<br />
<strong>Other Coder:</strong> Why upgrade if it works on PHP 4?</p>
<p><em>Yeah, saying that having Register Globals disabled on PHP 5 is a PHP bug is kind of missing the point.</em></p>
<p>Having spent a week &#8220;fixing&#8221; the code that depended on register globals, I was in discussion on trying to keep any new code from using it. It kept coming up on why PHP 5 was even needed. Which made me stop to think, was I imposing to much on the rest of the team? Nope, security was of great importance and could have prevented a major breach later.</p>
<p>Why upgrade? PDO, Mysqli, <strong>SPL</strong>, and I was really wanting to work with SPL at the time. I suppose I was kind of being a code Nazi with wanting to have the best tools available.</p>
<p>Register Globals just allows for such easy development, <em>which is wrong</em>. You should strive to code the right way, as much as possible. I usually allow for, &#8220;Eh. This code sucks and I hope no one sees it, but it works.&#8221; Only after months of trying to implement the &#8220;right way&#8221; and constant failure of trying to achieve that level.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2011/projects/calibre-improvements/">Calibre Improvements</a></li>
<li><a href="http://jacobsantos.com/2011/projects/dragonu-bug-tracker-dev-milestone-1/">DragonU Bug Tracker Dev &#8211; Milestone 1</a></li>
<li><a href="http://jacobsantos.com/2009/projects/dragon-mvc/">Dragon MVC</a></li>
<li><a href="http://jacobsantos.com/2009/projects/why-i-contributed-to-wordpress/">Why I Contributed to WordPress</a></li>
<li><a href="http://jacobsantos.com/2009/projects/dragonu-db-component/">DragonU DB Component</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/projects/story-time-register-globals-wtf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Patterns for PHP: Page Controller Draft</title>
		<link>http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/</link>
		<comments>http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/#comments</comments>
		<pubDate>Thu, 07 Sep 2006 19:11:27 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/general/patterns-for-php-page-controller-draft/</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/" title="Patterns for PHP: Page Controller Draft"></a>Patterns for PHP Contribution I&#8217;ve decided it would have been a mockery to PHP developers, if I had taken up writing about MVC, which I still barely know anything about. However, I have been working a little bit with Page &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/" title="Patterns for PHP: Page Controller Draft"></a><h3>Patterns for PHP Contribution</h3>
<p>I&#8217;ve decided it would have been a mockery to PHP developers, if I had taken up writing about MVC, which I still barely know anything about. However, I have been working a little bit with Page Controller Pattern of MVC. I decided I could write what little I do know and let someone with more knowledge fill in the blanks. Helping myself and others in the community.</p>
<h3>Types of Page Controllers</h3>
<p>From my experience, it seems Page Controlling falls into three categories, based on difficultly of implementation.</p>
<ol>
<li>IF Block Structure</li>
<li>Directory Structure</li>
<li>Object Method</li>
</ol>
<h3>If Block</h3>
<p>When I first seen this in Dragon Knight, I laughed like a fool. At the time, I was coding using multiple pages with no mod_rewrite. Nothing wrong with using multiple pages, however I noticed some security problems with the Dragon Knights method, which were fixed.</p>
<p>The structure is as follows:</p>
<pre class="brush: php; title: ;">
if($page == 'page_name') {

    // Do and include stuff

} else if($page == 'page_name') {

    // Do and include stuff

} else if($page == 'another_page_name') {

    // Do and include stuff

}
</pre>
<p>Really easy to do and the most basic representation of a Page Controller pattern. The <em>Page</em> variable can be from a <em>$_GET</em> key or from the url path function.</p>
<p>This method has flaws: for one, if there are many pages that need to be controlled, then the if block can get fairly large and hard to manage; and two, once it does get large, say around 1000 to 100000 blocks, it can be slow.</p>
<h3>Directory Structure</h3>
<p>This method has been bouncing around in my mind every since I read and heard the podcast about &#8220;PHP Best Practices&#8221; and for the life of me, I can&#8217;t remember where the blog and podcast is. I didn&#8217;t laugh, but I just thought that without any more information, such as PHP code, the podcast was pretty worthless. The statement was only having one index.php file that included all of the required files, adding some security and ease of development. It was interesting, but I didn&#8217;t &#8220;grok&#8221; it until several days ago when I was thinking about how to best maintain the Gamehole Page Controller.</p>
<p><strong>Note:</strong> I haven&#8217;t developed any code, but I do have some sort of pseudo-code for how to go about the method.</p>
<pre class="brush: php; title: ;">
// Get the path names for inclusion
$pathList = explode('/', $_SERVER['QUERY_STRING']);

// Find the amount of levels for directory and file inclusion.
$pathDepth = count($pathList);

define(&quot;PROJECT_PATH&quot;, realpath(dirname(__FILE__).'/../project'));

if($pathDepth == 0) {
     require PROJECT_PATH.'/controller/default.php';
} else {
    $path = PROJECT_PATH;
    foreach($pathList as $pathElement)
    {
        $file = $path.'/'.$pathElement;

        if($pathDepth == 1) {
            if(is_file($file)) {
                include($file);
            } else {
                if(is_file($file.'/default.php')) {
                    include($file.'/default.php');
                } else {
                    header(&quot;Status: 404 Not Found&quot;);
                }
            }
        } else {
            if(!is_dir($file)) {
                header(&quot;Status: 404 Not Found&quot;);
            }
        }

        $pathDepth--;    // Is Directory; Maybe
    }
}
</pre>
<p>The amount of lines is still less than Gamehole, even with the checks. Without any debugging this probably won&#8217;t work &#8220;out of box&#8221;. As a prototype, it is meant to collect the directory structure from the URL and finally the file, then include it after checking that it exists.</p>
<p>The advantage is that I wouldn&#8217;t have to touch the page controller at all to add new pages to the list. It also has less chance that I&#8217;ll forget a bracket and the whole PHP site would fail. Removing a single point of site failure is a problem that I needed to address with future development.</p>
<h3>Object Method</h3>
<p>Many frameworks and classes exist for handling the Page Controller using an object.</p>
<p>This is where my &#8220;tutorial&#8221; ends.  I have not yet developed with this method, so I know nothing how it works. I do hope to learn after working with the second method for a while.</p>
<p><strong>Update:</strong></p>
<p>The page controller I was looking for was <a href="http://weierophinney.net/phly/index.php?package=Cgiapp2">Cgiapp2</a>.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2011/projects/calibre-improvements/">Calibre Improvements</a></li>
<li><a href="http://jacobsantos.com/2011/projects/dragonu-bug-tracker-dev-milestone-1/">DragonU Bug Tracker Dev &#8211; Milestone 1</a></li>
<li><a href="http://jacobsantos.com/2009/projects/dragon-mvc/">Dragon MVC</a></li>
<li><a href="http://jacobsantos.com/2009/projects/why-i-contributed-to-wordpress/">Why I Contributed to WordPress</a></li>
<li><a href="http://jacobsantos.com/2009/projects/dragonu-db-component/">DragonU DB Component</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/projects/patterns-for-php-page-controller-draft/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Quest For Bug Tracking</title>
		<link>http://jacobsantos.com/2006/general/quest-for-bug-tracking/</link>
		<comments>http://jacobsantos.com/2006/general/quest-for-bug-tracking/#comments</comments>
		<pubDate>Sun, 30 Jul 2006 02:21:00 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/?p=258</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/general/quest-for-bug-tracking/" title="Quest For Bug Tracking"></a>As the Black Knight rode toward the horizon, he pondered the lasting effects his massacre upon the people will be. Defect: Sentence is Complete Crap and lacks originality. Enhancement: Learning to write without sadism. Enhancement: Change &#8216;Black Knight&#8217; to something &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/general/quest-for-bug-tracking/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/general/quest-for-bug-tracking/" title="Quest For Bug Tracking"></a><p>As the Black Knight rode toward the horizon, he pondered the lasting effects his massacre upon the people will be.</p>
<p>Defect: Sentence is Complete Crap and lacks originality.<br />
Enhancement: Learning to write without sadism.<br />
Enhancement: Change &#8216;Black Knight&#8217; to something that doesn&#8217;t suck.</p>
<h3>Reason to Use Bug Tracking</h3>
<p>Usually I just use this blog (spelled quickly is golb surpisingly), but I can&#8217;t close a bug using wordpress. It is also very hard to track down and find posts where I discuss features and problems. Not so much as difficult to find, but difficult to manage what features I&#8217;ve already completed and still need to do.</p>
<p>The natural next step would be to find, install and use a bug tracker.</p>
<p>Bug Trackers are a tool to better manage the project and it helps even if you only have one developer. It is impossible to keep track of every feature you have planned for a project. Once you use a bug tracker, it becomes a must have and very addictive part of planning.</p>
<h3>Turning Away From Bug Word Usage</h3>
<p>A better description is &#8216;defect&#8217; which Trac uses. I suppose explaining the term and its history to people is part of the issue. Not everyone takes interest or cares about obscure computer history. The term &#8216;defect&#8217; matches what the problem is, better than a bug, which crawls around and dies in computer systems.</p>
<p>The question I have is if Bugzilla will deflect and change its name to defectZilla? Perhaps not, it is more of &#8216;geek&#8217; application. It is unlikely that after the flame war towards anyone that suggests such a thing that it would ever be suggested again.</p>
<p>Mantis avoids the ambiguity all together by omiting the type and just using a number. Mantis resembles a Bugzilla clone, but misses features found in Bugzilla.</p>
<p><strong>Other nice terms:</strong></p>
<ul>
<li>Enhancement: A &#8216;bug&#8217; towards bettering part of the application.</li>
<li>Task: &#8216;bug&#8217; that describes a major feature or action towards completing a milestone.</li>
<li>Feature: Better word for &#8216;task&#8217; that better describes a new part of the application.</li>
</ul>
<h3>Bugzilla</h3>
<p>Fairly easy to install and use, but it is Perl. It is the most popular and &#8216;best&#8217; bug tracker out there or that is what everyone says. Given the amount of Perl modules, pretty much any feature could be added to Bugzilla to compete with other newcomers. The last news I heard about Bugzilla, they were debating on a feature like the Trac Roadmap.</p>
<p>What I take issue with, is that everything is a bug, no matter if it is an task, suggestion, RFC (Request For Comment), thread, feature, or task. You would think that in this &#8216;new age&#8217; that they would add a little big more diversity.</p>
<p>Perl is never going to die and I suppose with the proper Apache modules and configuration, it can be as fast as PHP if not more so.</p>
<p>Oh, I rate the design as crap, not that I can design anything better and it is why I don&#8217;t use it.</p>
<h3>Mantis</h3>
<p>Easier to install than Bugzilla, but I honestly didn&#8217;t give it much of a try before I finally successfully completed the  Trac install. I do remember the hideous &#8216;My View&#8217; page, but it is a good application.</p>
<p>My only gripe is that for some reason, along with Bugzilla, bug trackers believe they have to have the most complex design layouts. I just want the information that I need where I can easily get to it. Which is why I like the Trac design, it is simple and tells you what you need to know without redundantly going out of your way to do common tasks.</p>
<p>Yeah, I do plan to do something about it, but my task list is full for the next 6 months and if I do something, it would be to clone Trac bug tracking. Perhaps not what the project developers had in mind.</p>
<h3>Trac</h3>
<p>Dear God,</p>
<p>Why is Trac written in Python? Besides the obvious reasons.</p>
<h3>What I would Like to See</h3>
<p>I do like the basic project management the bug trackers offer, but I really like subcomponents. Let me give an example for major components and subcomponents.</p>
<p><strong>My Super Cool Project</strong></p>
<ol>
<li>Security
<ol type="I">
<li>General (Magic Quotes)</li>
<li>Filtering and Plugins</li>
<li>Session</li>
</ol>
</li>
<li>My Page
<ol type="I">
<li>Reports</li>
<li>Form 1</li>
</ol>
</li>
<li>Administration
<ol type="I">
<li>Users</li>
<li>Pages</li>
<li>Manage</li>
</ol>
</li>
</ol>
<p>I would also like to see a graphic presentation of the roadmap in a timeline chart, but that is really difficult.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/general/quest-for-bug-tracking/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>ActiveCollab: A Trac Killer?</title>
		<link>http://jacobsantos.com/2006/general/activecollab-a-trac-killer/</link>
		<comments>http://jacobsantos.com/2006/general/activecollab-a-trac-killer/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 17:38:47 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/?p=254</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/general/activecollab-a-trac-killer/" title="ActiveCollab: A Trac Killer?"></a>It is doubtful at such a early stage that activeCollab would break any hold that Trac currently has. Trac has been gaining popularity, but it is still missing some major feature points for some people. That and I&#8217;m tired of &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/general/activecollab-a-trac-killer/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/general/activecollab-a-trac-killer/" title="ActiveCollab: A Trac Killer?"></a><p>It is doubtful at such a early stage that <a href="http://www.activecollab.com/">activeCollab</a> would break any hold that <a href="http://trac.edgewall.org/">Trac</a> currently has. Trac has been gaining popularity, but it is still missing some major feature points for some people. That and I&#8217;m tired of the Database is Locked errors.</p>
<p>Unless you want to pay for something that the Zend Framework project has, then Trac is really your best option for project management. There are web sites that handle project management for you, but I like having the power to choose the application and install it myself.</p>
<h3>What it Does Right</h3>
<p>It does utilize JavaScript in a welcome fashion giving ActiveCollab a good start for &#8220;Web 2.0&#8243; style design. It allows mulitple page menu set ups based by what page you are on. Administration doesn&#8217;t list the project links and project links don&#8217;t list adminstration links in the top link area. You can still get around easily and smoothly, which helps with top link navigation.</p>
<h3>No Registering</h3>
<p>The owner has to set up all of the other accounts, which I find pointless on an opensource project. You <strong>want</strong> other people to help and forcing them to sign in isn&#8217;t going to make others happy. Since it is PHP, you could write your own Registering or link the account to another application, such as Mantis or Mediawiki. </p>
<h3>ActiveCollab Lacks A Bug Tracker</h3>
<p>It is a project manager meant to be used along side of a bug tracker (Trac, or Bugzilla, or Mantis) and wiki (Trac or Mediawiki or Dokuwiki). The Task tracker which handles the bug tracking isn&#8217;t all that great. Hell, <a href="http://www.mantisbt.org/">Mantis</a> would be far better as a PHP bug tracker. Now if only it was legal to rip the code off Mantis for ActiveCollab, aside from the unethical mindset, it would function far better.</p>
<p>I do have it in mind to create one for ActiveCollab, either based in part off of Mantis or off Bugzilla and Trac. Mantis would be the best choice since it has been in development for a long time (not as long as Bugzilla), and would be easier to refactor it for use in ActiveCollab. Designing and creating one from the ground up wouldn&#8217;t be the best choice, unless you&#8217;re going to incorporate some of the awesome Bugzilla or Trac features, which Mantis doesn&#8217;t have.</p>
<h3>No Wiki</h3>
<p>The only option for adding documents is uploading them. While bug tracking would be great as part of the application, the Wiki wouldn&#8217;t. You&#8217;ll probably end up with something less than Trac with very limited syntax options. Mediawiki isn&#8217;t as strict as Trac in wiki syntax, which I like.</p>
<p>I don&#8217;t think the author should recreate a wiki for the project. The best choice would be either using Mediawiki or Dokuwiki classes, databases, or linking to just the plain web site.</p>
<p>The reason why I would create the bug tracker is that it doesn&#8217;t involve major regular expression and html filtering support. Mediawiki does a great job at both, and the design could be changed as well as an extension for mediawiki created for linking to ActiveCollab documents, tasks, and projects.</p>
<h3>No Subversion Browsing</h3>
<p>Yeah, well, PHP doesn&#8217;t really allow you direct access to Subversion Repositories, so it makes sense. PHP does allow for accessing Subversion through command environment. The problem there is that Subversion would have to be installed before it could be used. Not all hosts would allow access to the command line because a lot of asses are raped with poor security considerations.</p>
<p>There is an early PECL extension for accessing Subversion, but not everyone is going to install PECL entensions and you can&#8217;t count of it being there. PHP implementation would be nice, but it would depend entirely on securing the input to the command. The Repository would also have to be cached to speed up the listing, which would lead to cronjobs.</p>
<h3>I Like Trac</h3>
<p>I wish Trac the best, but I dislike waiting for each version, including 0.11 which should remove a major dependency that really hurts in trying to install Trac. Installing Trac is easy, but some of the dependencies have to be &#8216;fixed&#8217; before you can install it. There are also a lot of dependencies for Trac and I would like it more if I could just install Trac like I would Mantis or activeCollab, with no dependency and minimal setup configuration.</p>
<p>It would help if I knew Python, so that I could help in the development, but I don&#8217;t see that happening anytime soon.</p>
<h3>Both Lack Graphic Timeline Representation</h3>
<p>It would be nice to see where in a graphic timeline all of the milestones came together and where repository branches came off. It would also see how long each bug took before completion.</p>
<p>It would be nice to have in either product, but it isn&#8217;t very easy to do correctly.</p>
<h3>Final Words</h3>
<p>For an early prototype version 0.6 is nice, but even activeCollab uses Trac for bug tracking. I suspect that will happen less as the application advances. I don&#8217;t think that it is ironic, a project should use as many great applications for project management.</p>
<p>I do plan on joining into the development later. I was planning on taking Mantis, Mediawiki, and creating the Subversion Browser for a project like this. It helps that something like that has already been started, so that it wouldn&#8217;t be difficult to jump on top of it. It is a nice project that I wouldn&#8217;t mind joining and helping on.</p>
<p>I don&#8217;t think it would be wise to create a branch for my own features added to it. I would rather that when I create the features that they are added. Having two different projects that are the same with different features wouldn&#8217;t help the community.</p>
<h3>Update</h3>
<p>It seems activeCollab is a clone of <a href="http://www.basecamphq.com/">Base Camp</a>, which is cool. ActiveCollab seems pretty close to what BaseCamp has, from the screenshot comparsion.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/general/activecollab-a-trac-killer/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web Hosts with Upgrading PHP Delay</title>
		<link>http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/</link>
		<comments>http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/#comments</comments>
		<pubDate>Wed, 26 Jul 2006 14:49:54 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/?p=250</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/" title="Web Hosts with Upgrading PHP Delay"></a>I understand the reason, but I can&#8217;t help but feel angry. For an Network Administrator to roll out an application without testing is not wise. However, it took a long time for Dreamhost to allow their users to work with &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/" title="Web Hosts with Upgrading PHP Delay"></a><p>I understand the reason, but I can&#8217;t help but feel angry. For an Network Administrator to roll out an application without testing is not wise. However, it took a long time for Dreamhost to allow their users to work with PHP 5 without the user installing it for themselves. I have heard that some hosts still have their head up their asses and force their users to use PHP 4.</p>
<p>I have tried on multiple occasions to setup my own web server on my computer to develop and test my scripts. On Windows with Apache, forget it. <a href="http://www.xitami.com/">Xitami</a> is for people like me who can&#8217;t or choose not to take the time to <strong>correctly setup</strong> Apache with PHP. Spending 4+ hours on research, testing, and configuration can drive me crazy.</p>
<p>Oh yeah, I did get it to work once, but it was one of those A(Apache)M(Mysql)P(PHP) for Windows. If all you are doing is testing your site on Windows, Xitami is a lot easier in my humble opinion.</p>
<h3>XDebug: A Reason to Install PHP for Yourself</h3>
<p>I will install PHP with XDebug to see where I&#8217;m going wrong with my PHP development. If it can let me know where my head is up my ass and how much overhead my objects have, then I&#8217;m all for it. Also, I would also like to test other applications to see where I can help. </p>
<p>It is an interesting topic about optimization, class overhead, and application bottlenecks. I don&#8217;t program to make money, it would be nice, but learning is fun and these topics are ripe for the picking.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/general/web-hosts-with-upgrading-php-delay/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>XMLHttpRequest Quirks and PHP</title>
		<link>http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/</link>
		<comments>http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/#comments</comments>
		<pubDate>Sun, 23 Jul 2006 13:19:49 +0000</pubDate>
		<dc:creator>santosj</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.santosj.name/?p=247</guid>
		<description><![CDATA[<a href="http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/" title="XMLHttpRequest Quirks and PHP"></a>I didn&#8217;t find the AJAX frameworks much use while I was working on my current project. I&#8217;m sure they are well thought out and designed, but after going through two or three, I was more lost than when I started. &#8230;<p class="read-more"><a href="http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/" title="XMLHttpRequest Quirks and PHP"></a><p>I didn&#8217;t find the AJAX frameworks much use while I was working on my current project. I&#8217;m sure they are well thought out and designed, but after going through two or three, I was more lost than when I started. I decided then that I should learn how this whole AJAX thing works from the ground up. Turns out XMLHttpRequest isn&#8217;t all that difficult, once you get past a few JavaScript cross browser hiccups.</p>
<h3>The PHP Back-end</h3>
<p>You have three methods for how you can display the information. Each one has its benefits and issues that you&#8217;ll need to address in JavaScript.</p>
<ol>
<li><strong>XML</strong></li>
<p>This is perhaps, the most used way. There are debates of the benefits of using XML, but JavaScript can be used to parse the XML. The speed in doing so, is up to how well you write the JavaScript code. I thought it was fun using this.</p>
<p><strong>Benefits:</strong></p>
<ul>
<li>Using XML does allow you to send all of the information back to JavaScript on the first request.</li>
<li>You can also request the same page using PHP or another language, so you aren&#8217;t limited to just JavaScript.</li>
</ul>
<p></p>
<li><strong>HTML</strong></li>
<p>You can send HTML to JS, but if you need multiple elements, then you will have to page them. For some reason, when I was sending multiple elements, it couldn&#8217;t &#8216;sense&#8217; the other elements. I think it needed a wrapper, such as a div around all of the elements. If not, then it will recognize the first element ID, but not any other.</p>
<p>It is quicker than XML parsing, so if you only need it to display, then this method works great.</p>
<li><strong>JSON</strong></li>
<p>There is a debate over using JSON over XML, but there are pros and cons for both sides. I don&#8217;t care about the debate, but for myself, I would rather like to use this method to save from parsing XML, but still receive an array of data. In PHP 5.2, they are adding a function that will make this an simple task, which is much needed. The PHP function should save a lot of time researching and testing.
</ol>
<p>It is really quite simple using PHP. The XMLHttpRequest object GETs or POSTs to the page just like the browser would, so you just code the page like you would if the browser was going to take a look out it, except you only need the information you are going to use.</p>
<h3>XMLHttpRequest Quirks</h3>
<p>Or what I like to call, &#8220;What you should know before you bash your head in to the wall causing brain damage.&#8221;</p>
<p><strong>Don&#8217;t Create an Instance of the Same Object For multiple Tasks</strong></p>
<p>Do so and it will throw an exception at you. The way to get around this is to create multiple objects that extend the original XMLHttpRequest Object or the one that you created for cross-browser development, like below.</p>
<p><strong>Don&#8217;t:</strong></p>
<pre class="brush: jscript; title: ;">
function myObject { }

myObject.prototype = new xmlTransport();

var object1 = new myObject;
var object2 = new myObject;
</pre>
<p><strong>Do:</strong></p>
<pre class="brush: jscript; title: ;">
function myObject1 { }

myObject1.prototype = new xmlTransport();

function myObject2 { }

myObject2.prototype = new xmlTransport();
</pre>
<p>Actually, the better method would be to use the same object and resend the requests getting what you need in the same object instead of creating multiple objects for the task.</p>
<h3>Always Call XMLHttpRequest Object First</h3>
<p>Once upon a time, before IE 7, you called the ActiveX first and then called the JavaScript object. This is not the case any longer. If you continue to do so for IE 7, you will still use the ActiveX component, which may not work if they disabled or blocked ActiveX. If you look for the object first, the request will still work.</p>
<pre class="brush: jscript; title: ;">
if(window.XMLHttpRequest)
{
	this.xmlhttp = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
	try {
		this.xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
	}
	catch(e)
	{
		try {
			this.xmlhttp = new ActiveXObject(&quot;Msxml2.XMLHttp&quot;);
		}
		catch(e2) { }
	}
}
</pre>
<p>Note, if this code looks familiar like the hundreds of other tutorials out there, then yeah. I did &#8216;borrow&#8217; it from another site. I don&#8217;t know JS enough to write it myself. However, I did modify it so that it looks for the XMLHttpRequest object first and the ActiveX Object last.</p>
<p><strong>Full Code:</strong></p>
<pre class="brush: jscript; title: ;">
function xmlTransport()
{
	this.xmlhttp = null;

	this._GetTransport();
}

xmlTransport.prototype._GetTransport = function()
{
	if(window.XMLHttpRequest)
	{
		this.xmlhttp = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		try {
			this.xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
		}
		catch(e)
		{
			try {
				this.xmlhttp = new ActiveXObject(&quot;Msxml2.XMLHttp&quot;);
			}
			catch(e2) { }
		}
	}

	if(this.xmlhttp == null)
	{
		alert(&quot;Constructor called and xmlhttp not Object&quot;);
	}
}

xmlTransport.prototype.isLoading = function()
{
	if(this.xmlhttp.readyState == 4)
	{
		return false;
	}

	return true;
}
</pre>
<p>I have the <strong>isLoading</strong> method in there, but I don&#8217;t ever use it. Which is funny, now that I think about it. I put the method in there so that I wouldn&#8217;t have to test readyState all of the time, but I found out that calling it is easier than trying to remember that there is a method that does that job for me. The method was suppose to display a loading message and what not, but I never got around to adding that feature.</p>

<p><strong>Possibly Related Posts:</strong></p>
<ul>
<li><a href="http://jacobsantos.com/2012/programming/game-engine-development-and-open-source/">Game Engine Development and Open Source</a></li>
<li><a href="http://jacobsantos.com/2011/programming/plans-for-base-cms/">Plans for Base CMS</a></li>
<li><a href="http://jacobsantos.com/2011/general/bullet-e-book-library-management-and-content-server/">Bullet: E-Book Library Management and Content Server</a></li>
<li><a href="http://jacobsantos.com/2011/general/using-zendframework-2-beta1-for-directory-project/">Using ZendFramework 2 beta1 For Directory Project</a></li>
<li><a href="http://jacobsantos.com/2011/programming/project-plans/">Project Plans</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://jacobsantos.com/2006/general/xmlhttprequest-quirks-and-php/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

