<?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>Chris Page - Software Engineer &#187; PHP</title>
	<atom:link href="http://www.chriswpage.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chriswpage.com</link>
	<description>... and student of Life, Philosophy, and Learning</description>
	<lastBuildDate>Sat, 17 Jul 2010 02:46:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apache Low Memory Settings + PHP + APC</title>
		<link>http://www.chriswpage.com/2010/04/apache-low-memory-settings-php-apc/</link>
		<comments>http://www.chriswpage.com/2010/04/apache-low-memory-settings-php-apc/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 19:27:07 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[Cool Tech]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/?p=413</guid>
		<description><![CDATA[In addition to moving my servers to save costs, I ran into a two part issue that I lumped into:  &#8220;I need to tune memory usage a bit&#8221;.  
Part 1:  Apache
Since I moved my Apache servers to lower memory instances, I was running into swap space usage that I could easily avoid, [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to moving my servers to save costs, I ran into a two part issue that I lumped into:  &#8220;I need to tune memory usage a bit&#8221;.  </p>
<h3>Part 1:  Apache</h3>
<p>Since I moved my Apache servers to lower memory instances, I was running into swap space usage that I could easily avoid, ie:</p>
<pre>
free -m
                      total       used       free     shared    buffers     cached
Mem:               268        245         22          0         71         53
-/+ buffers/cache:        120        147
Swap:               511         29        482
</pre>
<p>Some of the reasoning behind this was that, by default, Apache expects a bit more memory to be available than what I provided to it in the move.  The fix was to introduce a few settings to lower child processes and limit concurrent connections to something more reasonable to the type of traffic my site really gets &#8211; which is near nothing most days.</p>
<p>The settings I dropped into apache were:</p>
<p><strong>httpd.conf</strong>:</p>
<pre>
    #Low Memory Settings
    StartServers 1
    MinSpareServers 4
    MaxSpareServers 2
    ServerLimit 6
    MaxClients 6
    MaxRequestsPerChild 3000
</pre>
<p>I made the adjustments, cleared out the swap space with:</p>
<pre>
swapoff -a
swapon -a
</pre>
<p>Then restarted apache:</p>
<pre>
/etc/init.d/apache2 stop
/etc/init.d/apache2 start
</pre>
<p>And all was well in the world.</p>
<pre>
free -m
                       total       used       free     shared    buffers     cached
Mem:                268        207         60          0         31         79
-/+ buffers/cache:           97        170
Swap:                 511          0        511
</pre>
<h3>Part 2-1:  PHP</h3>
<p>A bit simpler, my blog site was running into max memory allocation limits.  I had left the default php.ini in place in the upgrade, so I needed to do a once over of configs and change memory_limit from 16M to something more reasonable for my site.</p>
<p><strong>php.ini</strong></p>
<pre>
memory_limit = 64M      ; Maximum amount of memory a script may consume (16MB)
</pre>
<h4>Part 2-2:  APC</h4>
<p>Having Apache settings set for lower memory usage also allowed me more room to increase my APC cache limit a bit higher to keep more pages faster.  From 30 MB to 50 MB.</p>
<p><strong>apc.ini</strong></p>
<pre>
extension=apc.so
apc.enabled=1
apc.shm_size=50
</pre>
<p>Other obvious solutions in consideration, switch to Rackspace to invert my memory/cpu requirement/cost ratios.  Any other tips are welcome <img src='http://www.chriswpage.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2010/04/apache-low-memory-settings-php-apc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mysql:  Force Localhost to Use TCP, Not a Unix Socket File</title>
		<link>http://www.chriswpage.com/2010/04/mysql-force-localhost-to-use-tcp-instead-of-unix-socket-file/</link>
		<comments>http://www.chriswpage.com/2010/04/mysql-force-localhost-to-use-tcp-instead-of-unix-socket-file/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 18:28:32 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[Cool Tech]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/?p=407</guid>
		<description><![CDATA[So, recently I decided I was paying too much for my server because I was not maximizing performance across all the various daemons.  So I decided to split my larger server into a handful of smaller servers to be able to fine tune each one to dedicated purposes.  All went well, but I [...]]]></description>
			<content:encoded><![CDATA[<p>So, recently I decided I was paying too much for my server because I was not maximizing performance across all the various daemons.  So I decided to split my larger server into a handful of smaller servers to be able to fine tune each one to dedicated purposes.  All went well, but I had some trouble for a few evenings figuring out how I could port forward localhost:3306 to the, now remote, database server.  This should have been dirt simple with an iptables rule &#8211; but after digging in, I discovered MySQL treats localhost &#8220;special&#8221; by sending connections through the unix socket file, which is absolutely faster, but only works if the database daemon is on the same host as the connecting application.</p>
<p>After doing some research, I found it is possible to use a tool like <a href="http://manpages.ubuntu.com/manpages/jaunty/man1/socat.1.html">socat</a> and <a href="http://manpages.ubuntu.com/manpages/gutsy/man1/autossh.1.html">autossh</a> to wrap an ssh tunnel to forward connections through the socket file to a remote IP over TCP.  This however, was more complex and one off than I cared to explore for my simple problem.  I finally resorted to using DNS and to stop using localhost as the host name.  However, a few tid bits for the weary traveler:</p>
<ul>
<li>The mysql client library is responsible for selecting the protocol.</li>
<li>PHP&#8217;s internal mysql libraries, unfortunately, as far as I could discover ( please correct me if I am wrong here ), do not allow you to select the protocol.</li>
<li>So if you&#8217;re using &#8220;localhost&#8221; as your host name in a PHP mysql_connect, you&#8217;re forced to go through the socket file, however, you can use 127.0.0.1 instead of localhost to force TCP.</li>
<li>The linux mysql-client package command line tool offers a <strong>&#8211;protocol=tcp</strong> flag if you want to force TCP.  You can also set this as a default inside <strong>/etc/mysql/my.cnf</strong> under the [client] heading</li>
</ul>
<p>my.cnf:</p>
<pre>
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
protocol        = TCP
</pre>
<p>Again, this appears to work fine if you&#8217;re not using PHP as your client.  </p>
<p>I hope this lesson learned ( use DNS ) comes as a helping hand to others out there.  If anybody has some other suggestions, please do leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2010/04/mysql-force-localhost-to-use-tcp-instead-of-unix-socket-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading from PHP 5.2 to 5.3 in Ubuntu &#8211; Part 1</title>
		<link>http://www.chriswpage.com/2009/07/upgrading-from-php-5-2-to-5-3-in-ubuntu-part-1/</link>
		<comments>http://www.chriswpage.com/2009/07/upgrading-from-php-5-2-to-5-3-in-ubuntu-part-1/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 16:11:40 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[Cool Tech]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/?p=290</guid>
		<description><![CDATA[( I&#8217;m publishing this partially done so that it acts as a reminder for me to FINISH it&#8230; bare with me! )
Overview of Important Changes
variable class naming
Previously in PHP, only method and function names could be variables.  Ie:
$func = "print";
$func("Hello World");
class Foo {
  public static function Bar()
  {
     echo [...]]]></description>
			<content:encoded><![CDATA[<p>( I&#8217;m publishing this partially done so that it acts as a reminder for me to FINISH it&#8230; bare with me! )</p>
<h2>Overview of Important Changes</h2>
<h4>variable class naming</h4>
<p>Previously in PHP, only method and function names could be variables.  Ie:</p>
<pre>$func = "print";
<span style="color:green">$func("Hello World");</span></pre>
<pre>class Foo {
  public static function Bar()
  {
     echo "Hello World";
  }
}

$method = "Bar";
<span style="color:green">Foo::$method();</span></pre>
<p>Now, in PHP 5.3+, variable class naming is also supported &#8211; making possible this syntax:</p>
<pre>class Foo {
  public static function Bar()
  {
     echo "Hello World";
  }
}

$class = "Foo";
$method = "Bar";
<span style="color:green">$class::$method</span></pre>
<p>This new class variable naming should provide a much desired level of ambiguity for PHP developers, I know for my MVC framework, it could really change the <a title="Typhoon PHP Run" href="http://dev.shockwavelabs.com/repositories/entry/swltyphoon/trunk/init.php#L165" target="_blank">Typhoon PHP Typhoon-&gt;run() method</a> in a positive way.</p>
<h4>late static binding</h4>
<p>This is a more advance PHP OOP topic &#8211; that almost came off as a bug in previous versions of PHP.  I&#8217;ve personally ran into it myself on occasion, and am happy to see a solution available in PHP 5.3.  In previous versions of PHP, static calls resolved to the inherited class.  In cases where one needed a static call to resolve in it&#8217;s own scope, unexpected results were common.  Ie:</p>
<pre>class Foo {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        self::who();
    }
}

class Bar extends Foo {
    public static function who() {
         echo __CLASS__;
    }
}

Bar::test();</pre>
<p>Output:</p>
<pre>Foo</pre>
<p>The solution, &#8220;Late Static Bindings&#8221;, solves this using the <span style="color:green">static</span> keyword:</p>
<pre>class Foo {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        <span style="color:green">static::who();</span>
    }
}

class Bar extends Foo {
    public static function who() {
         echo __CLASS__;
    }
}

Bar::test();</pre>
<p>The <span style="color:green">static</span> keyword resolves to the calling class and produces the expected output:</p>
<pre>Bar</pre>
<h4>Additions to Standard PHP Library (SPL)</h4>
<h4>Circular Garbage Collection</h4>
<h4>Lambda Functions (Anonymous Functions)</h4>
<h4>Closures</h4>
<h4>Overriding Internal Functions</h4>
<h4>New Reserved Words</h4>
<h4>Namespaces</h4>
<h4>Jump Labels</h4>
<h4>Changes to Functions and Methods</h4>
<h4>Extensions</h4>
<h3>Phar</h3>
<h4>php.ini Changes</h4>
<h4>Deprecated Methods</h4>
<h2>Install php 5.3 on Ubuntu</h2>
<pre>mkdir download &amp;&amp; cd download
wget http://snaps.php.net/php5.3-200906131830.tar.gz</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2009/07/upgrading-from-php-5-2-to-5-3-in-ubuntu-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Choosing the best platform for the job:  CMS Solution, PHP MVC, Django, or Ruby on Rails</title>
		<link>http://www.chriswpage.com/2009/05/choosing-the-best-platform-for-the-job-cms-solution-php-mvc-django-or-ruby-on-rails/</link>
		<comments>http://www.chriswpage.com/2009/05/choosing-the-best-platform-for-the-job-cms-solution-php-mvc-django-or-ruby-on-rails/#comments</comments>
		<pubDate>Thu, 14 May 2009 07:13:41 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[Cool Tech]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[shopping cart]]></category>
		<category><![CDATA[social network]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/?p=179</guid>
		<description><![CDATA[I see this all the time:  &#8220;I&#8217;m building a website, but I don&#8217;t know what the best technology to use is?  This guy says PHP,  that guy says Ruby.  What&#8217;s better?&#8221;.  While there are definitely a handful of developers that will quickly jump to share my point, there are far too many that have biases [...]]]></description>
			<content:encoded><![CDATA[<p>I see this all the time:  &#8220;I&#8217;m building a website, but I don&#8217;t know what the best technology to use is?  This guy says PHP,  that guy says Ruby.  What&#8217;s better?&#8221;.  While there are definitely a handful of developers that will quickly jump to share my point, there are far too many that have biases for certain technologies and will quickly defend them with a bullet list.  Avoid those guys with biases &#8211; their tool belts are smaller.</p>
<h4>Some things to Consider</h4>
<p>Choosing the best technology really depends on what it has to do.  You wouldn&#8217;t hit a screw with a hammer?  Well, you can&#8230; but you shouldn&#8217;t.  Choose your website technologies based on what it has to do and what it takes to create and support it.  Some things to consider:</p>
<ul>
<li>Budget and Market Cost</li>
<li>Continued Support and Development</li>
<li>Scalability &#8211; meaning, when new problems arise, will the solution be able to meet and defeat those problems?</li>
<li>Demographics &#8211; how well does the workforce powering your technology cater to your product&#8217;s needs?</li>
</ul>
<h3>Simple Sites</h3>
<p>Say, perhaps, you want to build a small website to advertise a product or yourself.  It needs a few dynamic options, like a contact form, and maybe a shopping cart.  I highly recommend exhausting service oriented solutions before going custom.</p>
<p>You could quickly find a web developer, blow a few hundred bucks, spend several weeks customizing and tweaking, and there you have it &#8211; no real support, you may or may not have a scalable back-end to manage it, and future expansions become expensive.  Or&#8230;</p>
<p>You could throw up a wordpress.com site for your landing page, link it to an inexpensive shopping cart service like e-junkie.com, and have significantly more bang for FREE by gaining access to thousands of plug-n-play plug-ins to extend your site with gallery applications, feeds, sharing tools, SEO management tools, as well as all the support of a service like e-junkie on call for your every e-commerce need.</p>
<p>See where I&#8217;m going with this?</p>
<h3>More Complex Project</h3>
<p>Lets envision you need something more complex than a personal page.  How about, a niche social network?  You want your own version of Myspace, and white label solutions just don&#8217;t have what it takes.  So you&#8217;ve raised thousands of dollars in angel investment, got your business plan, and are perplexed by the question of this post, &#8220;What technology?!?!&#8221;.  In this case, I would suggest considering the labor force and scalability behind each technology in correlation to what that is going to mean for your budget.</p>
<h4>PHP Frameworks</h4>
<p>While PHP has a huge work force, and many success stories, the language itself is rather controversial, as are philosophical differences in it&#8217;s &#8220;thousands&#8221; of frameworks.   A handful of frameworks are well-known, such as Symfony, CakePHP, Zend, CodeIgniter, KohanaPHP; though being an expert level PHP developer, I can tell you that many of the PHP frameworks, well, quite frankly, suck.  It&#8217;s new and easy to learn, and bloated with newbies making decent money, but not deploying consistent theory or solid code.  This is not always their fault, PHP lacks as a new language.</p>
<p>PHP also brings a lack of legacy support with each new version.  Consider the lifespan and size of your project.  Does this site need to run code for several years?  How difficult might it be to migrate old code to new versions of the language as they are released?  Just an example:  When  PHP5 released, it left thousands of web hosts outdated and incapable of updating without major financial and time expense due to the fact that PHP5 had changed syntax to introduce OOP, which broke PHP4.  To simply upgrade to PHP5 would break millions of websites without those webmasters first learning the changes in the language and making updates to their scripts.  Such scenario meant serious problems for web hosts that wanted to support latest technologies for new clients while maintaining legacy technology for existing clients.  PHP6 bodes better, but will still <a title="The future of PHP" href="http://www.ibm.com/developerworks/opensource/library/os-php-future/" target="_blank">admittedly face similar problems</a>.</p>
<p>As for the workforce, it&#8217;s just too easy to get into PHP.  The skill level required to create a PHP site is significantly less than that of other languages.  It&#8217;s the nature of PHP &#8211; Hypertext Pre-Processor, which, to many, is code (pun intended) for HTML on steroids.  Your average MySpace fanatic knows a bit of HTML these days, PHP is just the next informal step for many.  If you can find a skilled Object Oriented Programmer (<a title="Object Oriented Programming - A history of..." href="http://en.wikipedia.org/wiki/Object_oriented" target="_blank">OOP</a>) &#8211; you&#8217;re well off, but the work force powering PHP is predominately less read into computer science theory and less likely to deploy best practices.  Why should they? &#8211; that&#8217;s all part of the beauty of the language.</p>
<p>Not to say a quality website can&#8217;t be developed in PHP, but I haven&#8217;t worked with any particular PHP Framework that really nailed it for me as a perfectionist.  You&#8217;ll find many like me in the PHP work force:  &#8220;just another php framework author&#8221;.  There seems to be an abundant number of us that find it difficult to produce quality code in popular frameworks, causing us to resort to building our own.  Mine is coined <a title="Typhoon PHP MVC Framework" href="http://typhoon.shockwavelabs.com/" target="_blank">Typhoon</a>.</p>
<p>Though, don&#8217;t get me wrong, I LOVE PHP and have developed numerous websites in the language.  I also look forward to the great new benefits in Version 6.  When you come down to picking PHP for your choice as a platform tool, just be sure the scope of your project is small to medium sized, speed of development being important, and ongoing support of the project being minimal.  Past that, the coding standards recognized by the PHP community are just too flexible and inconsistent for me to feel comfortable  spending significant time and expense on a bigger PHP site.</p>
<h4>Django</h4>
<p><em>&#8220;Developed four years ago by a fast-moving online-news operation, Django was designed to handle two challenges: the intensive deadlines of a newsroom and the stringent requirements of the experienced Web developers who wrote it. It lets you build high-performing, elegant Web applications quickly.&#8221; &#8211; </em>from the creators of the <a title="Visit the Django Project" href="http://www.djangoproject.com" target="_blank">Django Project</a></p>
<p>Now Django is a cool framework built in the Python language, and perhaps the premier web framework of Python. Unlike PHP, Python is a general utility language. It&#8217;s usage can be found in many aspects of computer science from desktop applications, to video games, to web development &#8211; and it has been around awhile.</p>
<p>Lets keep in mind the quote above though.  It was developed by-and-for the newsroom.  As such, it caters VERY well to companies that have a similar infrastructure.  While you can develop many applications regardless, that fundamental purpose gives the framework an overall flavor that may not be quite as flexible in every problem domain.</p>
<p>The built in content management system (CMS) feature of Django is really quite a gem.  It&#8217;s effective at allowing developers to rapidly generate applications for non-technical people to manage.  Would I use it for a social network?  Probably not as my first pick.  Would I use it for news syndication site?  Hell yes.</p>
<p>Python has been around since the early 90&#8217;s and has had sufficient time to incorporate advanced computer science theory and stabilize.   The workforce powering Django applications is also significantly more well-read than the PHP workforce ( I say this loosely, of course ), as the Pythoon workforce has been around longer in general.</p>
<p>Django can sleep safe at night knowing it was built on a stable language that doesn&#8217;t anticipate significant change year after year, making it a great platform for websites requiring long term support and development.</p>
<h4>Ruby on Rails ( Soon to merge with <a title="MERB is joining forces with Rails!  " href="http://merbivore.com/" target="_blank">MERB</a> in Rails 3 )</h4>
<p>Talk about some BUZZ!  I&#8217;ll admit I did not want to learn Ruby on Rails at first.  I love learning technology, but when Rails was just gaining it&#8217;s hype, I was getting deep into PHP and tended to stay in the PHP world.  Mistake at the time, on my part.</p>
<p>Rails identifies itself as a &#8220;web framework&#8221;.  Unlike Django, Ruby on Rails was developed to tackle many more of the standard problems developers face on a much broader sense of web development.  This by itself should not be translated as &#8220;Rails is the creme de la creme&#8221; for your web project, but it does make it a strong candidate to initially consider.</p>
<p><strong>When to Consider Rails</strong></p>
<ul>
<li>You have a project with many developers, possibly several contractors that will come and go as needed.</li>
<li>You need fast scalability and flexibility due to a multi-faceted problem domain, ie:  niche social networks tend to start simple and then tack on lots of complex features.</li>
</ul>
<p><strong>Some Pros</strong></p>
<p>In terms of computer science, 9.9999 times out of 10, problems we face in development are problems we&#8217;ve answered time and time again, either in theory or practice.  Thankfully, the Rails community innately conforms to the <a title="Don't Repeat Yourself Principle (DRY)" href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" target="_blank">DRY Principle</a> ( don&#8217;t-repeat-yourself ).  The community also drastically alleviates extra invention faced by developers, simply by embracing, building upon, and reinforcing community accepted solutions.  The now famous Rails motto:  &#8220;Convention over Configuration&#8221; sets a tone where the community expects eachother to follow a standard set of approaches versus relying on the individual&#8217;s limited resources to reach the same conclusions others have already reached.</p>
<p>Not only is it a motto, it&#8217;s an obstacle for &#8220;do-it-my-way&#8221; programmers, as it&#8217;s rather difficult to make a Rails application without doing it the &#8220;Rails way&#8221; &#8211; things will just not go smoothly if you attempt to break standards.  As developers tend to think differently about the same problem domain, Rails lends itself as a great framework to conform the result of their different approaches to the same represented solution.  In identifying conventions and standards, developers of the rails community spend significantly less time &#8220;re-inventing the wheel&#8221;, and more time knocking out features and drinking beer.</p>
<p><strong>Some Cons</strong></p>
<p>It&#8217;s memory intensive/innefficient.  MERB is merging with Rails 3 &#8211; which promises to improve performance, though in the meantime, I have several Rails applications running for small sites where I should have deployed PHP, I&#8217;m noticing I&#8217;m low on memory due to such, which ultimately costs me more money to keep my servers up to par with my Rails demands.</p>
<p>Windows users tend to have a more difficult time with Rails whereas the PHP community has gone through a few more lengths to make development in windows fairly painless.  Rails is significantly is better to develop on unix-based platforms, like Linux and Mac.  Windows users will need to go through extra hoops to keep up with dependencies largely created and maintained by the unix-based users &#8211; though, if you&#8217;re a serious web programmer using windows as your primary platform, you should consider weening off sooner than later anyways.</p>
<p>Rails isn&#8217;t THAT light weight.  It incorporates a lot of functionality and sub framework patterns that you just may never use on some projects.  Again, Rails 3 promises to improve in this area as well.</p>
<p>[Conclusion Pending]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2009/05/choosing-the-best-platform-for-the-job-cms-solution-php-mvc-django-or-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Latest Happenings!</title>
		<link>http://www.chriswpage.com/2008/12/latest-happenings/</link>
		<comments>http://www.chriswpage.com/2008/12/latest-happenings/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 23:00:00 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[Family and Friends]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[family]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/2008/12/latest-happenings/</guid>
		<description><![CDATA[So I haven&#8217;t updated this blog in at least 6 months, and it&#8217;s been a very busy time indeed.
So first things first, I got married May 23rd to the beautiful Amber Ellifritz, now known as the beautiful Mrs. Amber Page ( us on the right ).  It&#8217;s been a wild and wonderful ride.  [...]]]></description>
			<content:encoded><![CDATA[<p>So I haven&#8217;t updated this blog in at least 6 months, and it&#8217;s been a very busy time indeed.</p>
<div id="attachment_48" class="wp-caption alignright" style="width: 310px"><img class="size-medium wp-image-48" title="Me and Amber" src="http://www.chriswpage.com/wp-content/uploads/2009/05/100_6304-300x225.jpg" alt="Snapped a shot along the Shenendoah in the fall" width="300" height="225" /><p class="wp-caption-text">Snapped a shot along the Shenendoah in the fall</p></div>
<p style="text-align: left;">So first things first, I got married May 23rd to the beautiful Amber Ellifritz, now known as the beautiful Mrs. Amber Page ( us on the right ).  It&#8217;s been a wild and wonderful ride.  We are now expecting!  She&#8217;s 4 1/2 months at this point.  We find out the gender in 2 days, then I plan on throwing a Baby Blue Victory party between now and Christmas <img src='http://www.chriswpage.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p style="text-align: left;">It&#8217;s clear I want a boy.</p>
<p style="text-align: left;">Shortly after we married, we moved to Charles Town, WV.  From there, I picked up remote work and since have churned out FirstString.com &#8211; a social network for high school athletes.  This has been an exciting project, we started it in Typhoon PHP, the www.shockwavelabs.com Framework, and a good 80% of it is still written in that framework, we are now writing new components in Ruby on Rails, which I&#8217;ve grown to adore.  It&#8217;s not perfect, but it is feature rich and gets the job done.</p>
<p style="text-align: left;">Speaking of Ruby, it presented a learning curve. The below image depicts said curve:</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<div id="attachment_49" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-49" title="Studying RoR" src="http://www.chriswpage.com/wp-content/uploads/2009/05/100_6797-300x225.jpg" alt="Studying Ruby on Rails" width="300" height="225" /><p class="wp-caption-text">Studying Ruby on Rails</p></div>
<p style="text-align: left;">As you can see.  It was easy.  I recommend everybody give it a shot.</p>
<p style="text-align: left;">
<p style="text-align: left;">[ ... ok my break is up, I need to go back to some projects, but I'll finish writing on this post at a later time ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2008/12/latest-happenings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate any HTML tag with these two functions.</title>
		<link>http://www.chriswpage.com/2008/04/generate-any-html-tag-with-these-two-functions/</link>
		<comments>http://www.chriswpage.com/2008/04/generate-any-html-tag-with-these-two-functions/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 23:44:00 +0000</pubDate>
		<dc:creator>cpage</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.chriswpage.com/2008/04/generate-any-html-tag-with-these-two-functions/</guid>
		<description><![CDATA[I was working on a form generation API on Typhoon PHP Framework today and came up with two wonderful functions for generating any HTML tag using PHP.
Here are the functions, enjoy!:

public static function tag($element, $attributes = array()) {
    $buffer = '&#60;' . $element;

    foreach($attributes as $key =&#62; $val) {
 [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on a form generation API on <a href="http://typhoon.shockwavelabs.com">Typhoon PHP Framework</a> today and came up with two wonderful functions for generating any HTML tag using PHP.</p>
<p>Here are the functions, enjoy!:</p>
<pre>
public static function tag($element, $attributes = array()) {
    $buffer = '&lt;' . $element;

    foreach($attributes as $key =&gt; $val) {
        $buffer .= ' ' . $key . '="' . $val . '"';
    }
    $buffer .= '/&gt;';

    return $buffer;
}

public static function blocktag($element, $attributes = array()) {
    $content = $attributes['content'];
    unset($attributes['content']);

    $buffer = '&lt;' . $element;
    foreach($attributes as $key =&gt; $val) {
        $buffer .= ' ' . $key . '="' . $val . '"';
    }
    $buffer .= '&gt;';

    $buffer .= $content;
    $buffer .= '&lt;/' . $element . '&gt;';

    return $buffer;
}</pre>
<p>Currently I use these in conjunction with Smarty helpers to create consistent markup across a project I&#8217;m working on.  Any thoughts are appreciated!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chriswpage.com/2008/04/generate-any-html-tag-with-these-two-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
