<?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>sync;sync &#187; Codeigniter</title>
	<atom:link href="http://andy.sinaptix.com/category/codes/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://andy.sinaptix.com</link>
	<description>flush the garbage</description>
	<lastBuildDate>Tue, 27 Oct 2009 09:44:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Akelos, Speaking Rails in PHP</title>
		<link>http://andy.sinaptix.com/2007/10/26/akelos-speaking-rails-in-php/</link>
		<comments>http://andy.sinaptix.com/2007/10/26/akelos-speaking-rails-in-php/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 19:34:23 +0000</pubDate>
		<dc:creator>Andy Awidarto</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://andy.sinaptix.com/2007/10/26/akelos-speaking-rails-in-php/</guid>
		<description><![CDATA[I got stumbled upon ( again ) Akelos, another PHP framework, but this time my short attention span seems didn&#8217;t work   &#8230;
Yeah, it seems mature and stable enough, and maybe because i&#8217;m in process of learning RoR now, that Akelos&#8217; claim of being &#8220;port of RoR in PHP languange&#8221; make more sense than [...]]]></description>
			<content:encoded><![CDATA[<p>I got stumbled upon ( again ) <a href="http://www.akelos.org" title="Akelos Framework" target="_blank">Akelos</a>, another PHP framework, but this time my short attention span seems didn&#8217;t work <img src='http://andy.sinaptix.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  &#8230;</p>
<p>Yeah, it seems mature and stable enough, and maybe because i&#8217;m in process of learning RoR now, that Akelos&#8217; claim of being &#8220;port of RoR in PHP languange&#8221; make more sense than before.</p>
<p>Why am i interested in Akelos ? There are several other PHP frameworks that claim to be &#8220;inspired by&#8221; or &#8220;ports of RoR&#8221; namely CakePHP, CodeIgniter ( inspired ones ) and PHP on Trax ( port ).</p>
<p>I&#8217;ve been using CodeIgniter for a while and like it so far, because it has great documentation, lightweight, and easy to extend, although as many other PHP frameworks, it tends to get hairy if the developer gets too excited or plain too old fashioned to adhere to MVC concept. the lack of automation and claim of being small, lightweight freeform MVC framework in CodeIgniter is likely the cause of such failure to enforce MVC separation and reuseability ( or DRY ). I don&#8217;t blame the creator, actually i like CI very much because it cuts a significant portion of my work on particular project, make everything so fast, and above all, fun.</p>
<p>After i tried Akelos however, i got more excited, because it has the same ease of use of CI, at least in terms of requirements, like it works in PHP4 and PHP5, the package is easy to install, through SVN and downloadable package, and self contained, it doesn&#8217;t get stranded to PEAR ( like PHP on Trax ). Personally i don&#8217;t like PEAR because i&#8217;ve encounter too much trouble setting up on many different kind of machine ( Windows, Linux, and now OS X ).</p>
<p>With the bonus of Rails like automation, like generator, migration, etc. which doesn&#8217;t currently exist in CI, Akelos should be fun to work with, after all , it is a port of Rails. So i think i will take a closer look at it, maybe it could become a good learning tool on Rails concepts. I know PHP for a long time , then it&#8217;s a bit hard to switch lane to Ruby, learning RoR using Akelos should be a logical way to gradually move to pure RoR world.</p>
<p>Mind you, I&#8217;m not into language / framework war, for me it&#8217;s just another language and another framework. I use them accordingly depending on my particular needs, so i don&#8217;t scrap one for another, but i simply put them in my personal toolbox to use any of them as required.</p>
<p>The reason i don&#8217;t pick CakePHP is because it&#8217;s a whole different kind of framework although it has many of good features of RoR ( automation with bake, ORM, etc ). PHP on Trax, hmm, PEAR, so i think i&#8217;ll pass. I pass on other PHP frameworks too because they are PHP5 only, which is not good for the moment since my servers are still running PHP4, although they have great features too.</p>
<p>So, Akelos should be good enough now, although I don&#8217;t think it will match RoR fame, but it will become a fresh breath of air on PHP world, particularly in this moment where PHP gets mocked as inferior than Ruby or Python ( or other languages by fact ). Other thing is I actually like the modest attitude of Bermi Ferrer, Akelos&#8217; creator. DHH is just simply irritating, but i still respect him as a great programmer.</p>
]]></content:encoded>
			<wfw:commentRss>http://andy.sinaptix.com/2007/10/26/akelos-speaking-rails-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Username as Subdomain in Codeigniter a.k.a Wildcard Subdomain</title>
		<link>http://andy.sinaptix.com/2007/08/22/username-as-subdomain-in-codeigniter/</link>
		<comments>http://andy.sinaptix.com/2007/08/22/username-as-subdomain-in-codeigniter/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 14:53:21 +0000</pubDate>
		<dc:creator>Andy Awidarto</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[On Codes]]></category>

		<guid isPermaLink="false">http://andy.sinaptix.com/2007/08/22/username-as-subdomain-in-codeigniter/</guid>
		<description><![CDATA[I&#8217;ve been wondering for a while if I can do automatic subdomain using username, same as Wordpress MU does. Some thought come across and all leads to same point , the $base_url() variable.
What makes me a bit wary is that particular variable reside in config file, which suppose to be static. On the other hand, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wondering for a while if I can do automatic subdomain using username, same as Wordpress MU does. Some thought come across and all leads to same point , the <code>$base_url()</code> variable.</p>
<p>What makes me a bit wary is that particular variable reside in config file, which suppose to be static. On the other hand, manipulating the variable in controller is easy but redundant. So what the heck&#8230;<br />
There are three places to modify for this :</p>
<ol>
<li> DNS entry</li>
<li> Apache vhost</li>
<li> Codeigniter config.php</li>
</ol>
<p>Life has been good to me since I have full control over those three, I have my own DNS server, and apache server, so if you are less fortunate than I am, do not hesitate to nag , beg and annoy your hosting company to do changes for you</p>
<p><strong>DNS entry :<br />
</strong><br />
make sure you put wildcard entry :<br />
<code>mygreatsite.com.           A       123.123.123.001<br />
*.mygreatsite.com.        A       123.123.123.001</code><br />
<strong> Apache vhost :<br />
</strong><br />
We use separate vhost file for each domain, and include those files using Apache &#8220;Include&#8221; directive, to keep things tidy and avoid fiddling with main apache config.<br />
<code>&lt;virtualhost&gt;<br />
ServerName mygreatsite.com<br />
ServerAlias *.mygreatsite.com<br />
ServerAdmin superduperadmin@superduperwebcompany.com<br />
#RedirectMatch 301 (.*) http://mygreatsite.com$1<br />
DocumentRoot /var/oi/keepcodeigniterhere<br />
&lt;directory&gt;<br />
Options Indexes FollowSymLinks MultiViews<br />
&lt;/directory&gt;<br />
AllowOverride All<br />
Order allow,deny<br />
allow from all<br />
&lt;/virtualhost&gt;<br />
</code><br />
the most important part is :<br />
<code> #RedirectMatch 301 (.*) http://mygreatsite.com$1</code><br />
<strong>CodeIgniter config.php :</strong></p>
<p>I test using this simple hack ( on the config.php ) :<br />
<code> $config['base_url']     = "http://".$_SERVER["HTTP_HOST"];<br />
</code><br />
And wala !! I can test using whatever.mygreatsite.com and codeigniter still working as if there is nothing wrong with <code>$base_url</code> variable, therefore you can use any words ( hence, wildcard ) as subdomain prefix and apache will direct the request to the same codeigniter installation. Next step I will do is using username as subdomain, eliminating ugly url like<br />
<code>http://www.mygreatsite.com/someuser/profile</code><br />
and make it nicer as in<br />
<code>http://someuser.mygreatsite.com/profile</code><br />
Nice !!<br />
Yeah I know I have to test rigorously to ensure nothing is broken with codeigniter ( and my application ) but at this moment I think it leads to the right direction.<br />
I also do some search at CodeIgniter&#8217;s forum just to verify my method and I&#8217;ve found great reference :<br />
<a href="http://codeigniter.com/forums/viewthread/51627/">http://codeigniter.com/forums/viewthread/51627/</a></p>
<p>For wildcard DNS, take a look at this guide by Wordpress creator :<br />
<a href="http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/">http://photomatt.net/2003/10/10/wildcard-dns-and-sub-domains/</a></p>
<p>from those forum entry, I&#8217;ve made final modification to the config.php file :<br />
<code>$config['base_url']     = "http://".$_SERVER["HTTP_HOST"];<br />
// provide easy to access variables for the rest of the application<br />
$usernamehost = explode('.', $_SERVER['HTTP_HOST'], 2);<br />
$config['tld_base_url'] =  $usernamehost[1]; // contains "domain.com"<br />
$config['user_base_url'] = $usernamehost[0]; // contains "sub"<br />
</code><br />
Hopefully this will work as expected , and also useful to anybody who wants to achieve similar thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://andy.sinaptix.com/2007/08/22/username-as-subdomain-in-codeigniter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting Around with MVC Framework</title>
		<link>http://andy.sinaptix.com/2007/07/30/getting-around-with-mvc-framework/</link>
		<comments>http://andy.sinaptix.com/2007/07/30/getting-around-with-mvc-framework/#comments</comments>
		<pubDate>Sun, 29 Jul 2007 18:53:18 +0000</pubDate>
		<dc:creator>Andy Awidarto</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[J2ME]]></category>

		<guid isPermaLink="false">http://andy.sinaptix.com/2007/07/30/getting-around-with-mvc-framework/</guid>
		<description><![CDATA[I&#8217;ve been using MVC frameworks for a while now, and it makes me think why I didn&#8217;t use it earlier&#8230; Yeah, back when I started learn programming I was exposed to procedural way of thinking, remember BASIC on IBM XT ( Yup, I wrote my first program on those awkward looking beige box from IBM, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using MVC frameworks for a while now, and it makes me think why I didn&#8217;t use it earlier&#8230; Yeah, back when I started learn programming I was exposed to procedural way of thinking, remember BASIC on IBM XT ( Yup, I wrote my first program on those awkward looking beige box from IBM, with amber monitor and glorious Hercules graphic card  ), and that&#8217;s already called a luxurious home PC, considering that at the time, my sister work involving boxes of punched cards and magnetic tapes <img src='http://andy.sinaptix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Ok, back to MVC, I&#8217;m not going to do another framework comparison here, rather, just a story about my learning experience&#8230;</p>
<p>My first encounter with MVC was using Java, learning to program desktop application using Swing and AWT, pretty enlightening experience, but i dropped it somehow because I have no real use for it, let alone any project to work on using it&#8230; then came J2ME, when I really have fun with, creating interesting stuff for mobile devices. I also learn a lot about object oriented programming concept here, another interesting stuf, tightly related to MVC.</p>
<p>Now, so many MVC frameworks pops up, it&#8217;s confusing &#8230; all popular programming languages have at least one implementation of it as a framework, notably Ruby on Rails,  Python&#8217;s Django &amp; Turbogears, PHP&#8217;s Prado, CakePHP, CodeIgniter, and many others&#8230;</p>
<p>Which one do I use ? I tried not to get stuck and become single minded on a framework, since in my perspective, all is just tools to get things done. Currently I use CodeIgniter for my project, while I also use Django to learn Python. Why, because CodeIgniter seems to be easiest to learn, and have certain tolerance to my lazy and messy programming practice <img src='http://andy.sinaptix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , tried CakePHP once, and I was lost in convention of plural singular naming&#8230; I notice Django has similar idiosyncracies, but I think I&#8217;m a bit more ready for it , after all, it&#8217;s in different language so everything is new ( I think it&#8217;s just me, it is hard to do things on convention, while I already get used to the way PHP done stuff, free and very tolerance to any kind of programming style )</p>
<p>Beware though, for those who just want to start learn programming, jumping into a framework to learn the language ( and learn programming in general ), is not recommended practice. I suggest learning from the very basic, the very fundamental concept like what is programming, what is procedural, OOP, functional programming, and so on. Otherwise, learning using a framework is like signing up to a flying school to learn to fly, but jump direct into the cockpit of a 747 to learn the &#8220;basic&#8221; of flying and being a pilot.</p>
]]></content:encoded>
			<wfw:commentRss>http://andy.sinaptix.com/2007/07/30/getting-around-with-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Social Network In Techno Tongue</title>
		<link>http://andy.sinaptix.com/2007/07/15/social-network-in-techno-tongue/</link>
		<comments>http://andy.sinaptix.com/2007/07/15/social-network-in-techno-tongue/#comments</comments>
		<pubDate>Sat, 14 Jul 2007 18:43:56 +0000</pubDate>
		<dc:creator>Andy Awidarto</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[On Codes]]></category>

		<guid isPermaLink="false">http://andy.sinaptix.com/2007/07/15/social-network-in-techno-tongue/</guid>
		<description><![CDATA[I&#8217;ve been working on a social networking site for a while now, and here&#8217;s some basic concept I&#8217;ve learn from he process ( warning : These are based on my experience, maybe different with you, but what do i care&#8230; ) :
Basic Entity of a Social Network Site :

User ( could be Person or anything [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a social networking site for a while now, and here&#8217;s some basic concept I&#8217;ve learn from he process ( warning : These are based on my experience, maybe different with you, but what do i care&#8230; ) :</p>
<p>Basic Entity of a Social Network Site :</p>
<ol>
<li>User ( could be Person or anything else, think about social network for your pet )</li>
<li>Message</li>
<li>File</li>
</ol>
<p>Expecting something more ? well, I tell you, nothing more than these I can tell you about <img src='http://andy.sinaptix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Anything else is built on top of those entities as extension, or simply connecting those three, in meaningful way of course.</p>
<p>Example :</p>
<ul>
<li>User connected to other User as friend</li>
<li>User send Message to other User, to her / his friends, or simply make it available to public</li>
<li>A File attached to a Message sent from one User to another.</li>
<li>User make a mark ( a tag , for you pundits ) to a File, then send Message to other user about it.</li>
<li>User make comment on other User&#8217;s Message with a File attached to it, a comment itself is another form of Message</li>
</ul>
<p>Think about it, we can create so many other kind of  relationship between those three objects, tangle it, twist it, of course it has to be in meaningful way, and then you got your social networking site, as simple as that, in a geek point of view.</p>
<p>So far, with all these basic knowledge about those three basic entities, I have abandon one CMS system ( Drupal, sorry for all you Drupal fans out there&#8230; ) because I then realize that generic CMS can only accomodate the relationship the way it want me to, not the way I want it to, well, maybe because I have insufficient knowledge for the CMS, or maybe I just mess around too much with it, I don&#8217;t know&#8230; All I know is that I can&#8217;t get scalability and speed by just plugging around all different add-on modules created by all different people and way of thinking and then try to configure smoothly as if it was all come from same people.  It was simply hard to imagine how to scale up, if early in development phase you already have at least 40 tables in the default database ( yaiksss&#8230; ), not to mention the way add-on, modules, and hooks works&#8230; with more than 20 modules installed, a simple process like saving a node will take significant time since the system will have to enquire which hook implementation should be triggered, and amny other part of the system need to be triggered to keep everything in sync.</p>
<p>I tell you, it was like fishing with a shot gun&#8230; really, you are on boat, aiming for a fish with your shot gun, fire up, and then &#8230; the thundering sound will drive away the fish , along with everything else that can move, and the shot gun kick back will send you off the boat on the other direction <img src='http://andy.sinaptix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8230; not good, not good&#8230;</p>
<p>I move on rewriting the whole thing, using CodeIgniter, a sleek simple MVC based PHP framework, and so far I get by with only 15 tables in my database to carry all the data required by those 3 basic entities, including all the relationships between them, not a bad setup, as I expect I will end up with less than 20 tables when the site will be launched.</p>
<p>Okay, I admit, I do a great deal of denormalization, because I need speed and less query, the wisdom came from my mobile content days&#8230; And I also feel sick about table joins, so I&#8217;d rather make the DBAs and business application programmers disappointed, than make my life less joyful, couldn&#8217;t care less about their feelings anyway, if you ask me&#8230; After all, theory is good, but when you have to face real world, all you can think of is how to get there in simplest, fastest way possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://andy.sinaptix.com/2007/07/15/social-network-in-techno-tongue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
