<?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>Steve&#039;s Blog &#187; crindigan</title>
	<atom:link href="http://crindigo.com/blog/tag/crindigan/feed/" rel="self" type="application/rss+xml" />
	<link>http://crindigo.com/blog</link>
	<description>Escapades of a web programmer</description>
	<lastBuildDate>Sun, 18 Sep 2011 04:40:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Wildfire Log Adapter for Solar</title>
		<link>http://crindigo.com/blog/2010/05/wildfire-log-adapter-for-solar/</link>
		<comments>http://crindigo.com/blog/2010/05/wildfire-log-adapter-for-solar/#comments</comments>
		<pubDate>Sat, 29 May 2010 05:25:59 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[crindigan]]></category>
		<category><![CDATA[solar]]></category>

		<guid isPermaLink="false">http://crindigo.com/blog/?p=74</guid>
		<description><![CDATA[While doing some more development for Crindigan, I figured I should be looking for a better way to show debug information than putting it in the page footer, so I looked at FirePHP. Unfortunately the Firephp log adapter in Solar &#8230; <a href="http://crindigo.com/blog/2010/05/wildfire-log-adapter-for-solar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While doing some more development for Crindigan, I figured I should be looking for a better way to show debug information than putting it in the page footer, so I looked at FirePHP. Unfortunately the Firephp log adapter in <a href="http://solarphp.com/">Solar</a> was out of date, so I wrote a quick adapter that uses the newer Wildfire protocol.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Log adapter that works with the latest FirePHP version
 * (probably not FireConsole though, whenever it's released).
 *
 * @package Crindigan
 * @author Steven Harris
 * @license http://opensource.org/licenses/bsd-license.php BSD
 * @version $Id$
 */
class Rpg_Log_Adapter_Wildfire extends Solar_Log_Adapter {

    /**
     * Default configuration values.
     *
     * @config string|array events The event types this instance
     *   should recognize; a comma-separated string of events, or
     *   a sequential array.  Default is all events ('*').
     *
     * @config dependency response A Solar_Http_Response dependency injection.
     *
     * @var array
     *
     */
    protected $_Rpg_Log_Adapter_Wildfire = array(
        'events'   =&gt; '*',
        'response' =&gt; 'response',
    );

    /**
     * The Solar_Http_Response where headers will be sent.
     *
     * @var Solar_Http_Response
     */
    protected $_response;

    /**
     * The Solar_Json instance used to encode JSON for Wildfire.
     *
     * @var Solar_Json
     */
    protected $_json;

    /**
     * Wildfire header index to keep headers in sequential order.
     *
     * @var int
     */
    protected $_index = 0;

    /**
     * Post-construction tasks. Sets up the response, JSON, and default Wildfire headers.
     */
    protected function _postConstruct() {
        parent::_postConstruct();

        $this-&gt;_response = Solar::dependency('Solar_Http_Response', $this-&gt;_config['response']);

        $this-&gt;_json = Solar::factory('Solar_Json');

		$this-&gt;_response-&gt;setHeader('X-Wf-Protocol-1', 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2');
        $this-&gt;_response-&gt;setHeader('X-Wf-1-Plugin-1', 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3');
        $this-&gt;_response-&gt;setHeader('X-Wf-1-Structure-1', 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1');
    }

    /**
     * Writes the log message to FirePHP.
     *
     * @param  string $class Class name.
     * @param  string $event Event name.
     * @param  mixed  $descr Log data. Any data type should work, assuming it can be encoded as JSON.
     * @return bool Always true.
     */
    protected function _save($class, $event, $descr) {
    	$meta = array();
    	$meta['Type']  = 'LOG';
    	$meta['Label'] = &quot;$class-$event&quot;;

    	$data = $this-&gt;_json-&gt;encode(array($meta, $descr));
    	$len  = strlen($data);

		if ( strlen($data) &lt;= 4990 ) {
			$this-&gt;_index++;
			$this-&gt;_response-&gt;setHeader(&quot;X-Wf-1-1-1-{$this-&gt;_index}&quot;, &quot;$len|$data|&quot;);
		} else {
			$chunks = chunk_split($data, 4990, &quot;\n&quot;);
			$parts = explode(&quot;\n&quot;, $chunks);
            $num_parts = count($parts);
            for ( $i = 0; $i &lt; $num_parts; $i++ ) {
				$this-&gt;_index++;
				$this-&gt;_response-&gt;setHeader(&quot;X-Wf-1-1-1-{$this-&gt;_index}&quot;,
					($i == 0 ? $len : '') . &quot;|{$parts[$i]}|&quot; . (($i == $num_parts - 1) ? '' : '\\'));
            }
        }

        return true;
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://crindigo.com/blog/2010/05/wildfire-log-adapter-for-solar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crindigan: An Introduction</title>
		<link>http://crindigo.com/blog/2009/12/crindigan-an-introduction/</link>
		<comments>http://crindigo.com/blog/2009/12/crindigan-an-introduction/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 01:12:36 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[crindigan]]></category>

		<guid isPermaLink="false">http://crindigo.com/blog/?p=48</guid>
		<description><![CDATA[This entry is meant to quickly describe what Crindigan is, and what led to its creation. As the description on Google Code states, it is basically a web-based role playing game, played through a user&#8217;s browser using standard technologies like &#8230; <a href="http://crindigo.com/blog/2009/12/crindigan-an-introduction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This entry is meant to quickly describe what Crindigan is, and what led to its creation.</p>
<p>As the description on Google Code states, it is basically a web-based role playing game, played through a user&#8217;s browser using standard technologies like AJAX to enhance the experience. You create your first character, then spend artificial money to purchase new recruits, items, and equipment. You can organize the characters into multiple squads, then use those squads to explore the game world and fight enemies/other parties.</p>
<p>Crindigan is actually my third attempt at creating a web application like this. My first attempt started in the Fall of 2005, maybe six months after starting to learn PHP. Back then, I really had no knowledge of proper application design, and so it was a sloppy jumble of code based on the &#8220;RPG Creator System&#8221; program badly ported to an object-oriented architecture. It eventually died off after a few months, as it was a pain to look at.</p>
<p>My second attempt started a year after the first, in Fall 2006. This one lasted for over two years, with the last change happening in December 2008. It only worked with the vBulletin forum software, and in fact had portions of its architecture based on it, such as session and input handling. The RPG started out in PHP4, and went through some small rewrites and design changes, but nothing drastic. In the end, I had a 17,000 line codebase written with PHP5 features, that also included a couple thousand lines of JavaScript for fancy battle, equipment, and skill learning screens. Why did I abandon it? It was still running on the architecture I made in 2006, with a few hacks added on top of it for things like fancy URLs. There was no clear separation between the model and the view, and new features were becoming harder and more clumsy to add. At this point, I had two choices: continue adding hacks to the existing codebase, or rewrite it from scratch. Since I now had almost four years of programming experience, I opted for the rewrite, mainly as a test to see how far I progressed and whether or not I could finally make something maintainable.</p>
<p>And that&#8217;s how the Crindigan project came to fruition. Of course, it didn&#8217;t really have a name until this summer. Development has been slower than I would like, but at least I&#8217;m now feeling proud about the code I&#8217;m writing. From the start, I declared that PHP 5.2 would be a requirement, and I would force myself to follow the MVC design pattern, which has really helped to keep my code clean. Most of the work I&#8217;ve done has been on the framework rather than the application itself, though things like logging in were written, along with parts of the style. My next task is to rethink how I&#8217;m handling updates and inserts through the Model, such as making it a bit smarter but without overdoing it, as I&#8217;m not particularly interested in coding a full-blown ORM. After that comes a forms library, then finally I can get to the application itself.</p>
<p>See you next article!</p>
<p><a href="http://code.google.com/p/crindigan/">Crindigan @ Google Code</a><br />
<a href="http://www.ohloh.net/p/crindigan">Crindigan @ Ohloh</a></p>
]]></content:encoded>
			<wfw:commentRss>http://crindigo.com/blog/2009/12/crindigan-an-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Absence of Stability</title>
		<link>http://crindigo.com/blog/2009/12/absence-of-stability/</link>
		<comments>http://crindigo.com/blog/2009/12/absence-of-stability/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 03:38:02 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[crindigan]]></category>

		<guid isPermaLink="false">http://crindigo.com/blog/?p=49</guid>
		<description><![CDATA[Funny how when I run this site off the latest WordPress SVN, version 2.9 coming out of beta only means that I&#8217;m now running 3.0 alpha. In other news, I&#8217;ll be trying to post an introduction to my Crindigan project &#8230; <a href="http://crindigo.com/blog/2009/12/absence-of-stability/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Funny how when I run this site off the latest WordPress SVN, version 2.9 coming out of beta only means that I&#8217;m now running 3.0 alpha. <img src='http://crindigo.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<p>In other news, I&#8217;ll be trying to post an introduction to my <a href="http://code.google.com/p/crindigan/">Crindigan</a> project soon. I did a little bit more work on the codebase tonight, though I really need to get it in gear before it becomes pseudo-vaporware and people brush it off as another abandoned newbie project.</p>
]]></content:encoded>
			<wfw:commentRss>http://crindigo.com/blog/2009/12/absence-of-stability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

