<?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>david rasch - making stuff work &#187; PHP</title>
	<atom:link href="http://www.davidrasch.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.davidrasch.com</link>
	<description></description>
	<lastBuildDate>Mon, 04 Apr 2011 00:53:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>stopgaps</title>
		<link>http://www.davidrasch.com/2007/09/20/stopgaps/</link>
		<comments>http://www.davidrasch.com/2007/09/20/stopgaps/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 02:28:25 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[iContact]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[error handling]]></category>
		<category><![CDATA[stopgap]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/09/20/stopgaps/</guid>
		<description><![CDATA[<p>In high-school, the teacher who taught a programming class and worked to write a Java-based voting system insisted they build in logging functionality, in spite of the iron-clad storage of data into text files. This discussion made an impression upon me because the best and worst thing about programming and computers is they do <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/09/20/stopgaps/">stopgaps</a></span>]]></description>
			<content:encoded><![CDATA[<p>In high-school, the teacher who taught a programming class and worked to write a Java-based voting system insisted they build in logging functionality, in spite of the iron-clad storage of data into text files.  This discussion made an impression upon me because the best and worst thing about programming and computers is they do <strong>exactly</strong> what they&#8217;re told to do.  Unfortunately, this means that the error of lowly humans can easily seep into what the code or program asks the computer to do.  </p>
<p>We were reminded of this lesson at iContact.  Just because your software &#8216;should&#8217; never do something, doesn&#8217;t mean you shouldn&#8217;t make these rules explicit.  An emergency bugfix to our queues at iContact had a trojan horse to allow messages from Client A to be matched with subscribers from Client B.  Clearly this is bad, and now we&#8217;re putting a patch in to detect and throw exceptions if any situation like this occurs. This is, however, a great example of where things that should never happen are still worthy of writing software to prevent.  It&#8217;s not shameful, it&#8217;s insightful to admit that as a programmer we are human and don&#8217;t understand as much as we might like.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/09/20/stopgaps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP on the Backend (part 2)</title>
		<link>http://www.davidrasch.com/2007/05/08/php-on-the-backend-part-2/</link>
		<comments>http://www.davidrasch.com/2007/05/08/php-on-the-backend-part-2/#comments</comments>
		<pubDate>Tue, 08 May 2007 23:34:02 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[daemon]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/05/08/php-on-the-backend-part-2/</guid>
		<description><![CDATA[<p>To run the class I posted yesterday, I typically use a class called DaemonRunner. This class sets up for proper signal handling, and &#8216;executes&#8217; the class extended from Daemon.</p> declare(ticks=1); class DaemonRunner { public static function exec($className) { $argv = $_SERVER['argv']; $daemon = new $className($argv); $daemon->init(); while (!$daemon->isDone()) { $daemon->run(); } $daemon->shutdown(); } } <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/05/08/php-on-the-backend-part-2/">PHP on the Backend (part 2)</a></span>]]></description>
			<content:encoded><![CDATA[<p>To run the class I <a href="http://www.davidrasch.com/2007/05/07/php-on-the-backend/">posted yesterday</a>, I typically use a class called <em>DaemonRunner</em>.  This class sets up for proper signal handling, and &#8216;executes&#8217; the class extended from Daemon.</p>
<pre>
declare(ticks=1);

class DaemonRunner {
    public static function exec($className) {
        $argv = $_SERVER['argv'];
        $daemon = new $className($argv);
        $daemon->init();
        while (!$daemon->isDone()) {
            $daemon->run();
        }
        $daemon->shutdown();
    }
}
</pre>
<p>The first statement is a PHPism.  This allows PHP to check for signals every 1 <em>tick</em>.  A tick is simply a low-level PHP interpreter step.  The way I&#8217;ve setup my daemon and signal handling by default, the PHP will finish its current iteration and then quit when receiving a signal.  This ensures that the database, and whatever background stuff aren&#8217;t left in inconsistent states.  As with anything, you&#8217;re free to modify, extend, or otherwise alter this behavior.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/05/08/php-on-the-backend-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP on the Backend</title>
		<link>http://www.davidrasch.com/2007/05/07/php-on-the-backend/</link>
		<comments>http://www.davidrasch.com/2007/05/07/php-on-the-backend/#comments</comments>
		<pubDate>Tue, 08 May 2007 00:55:39 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[daemon]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/05/07/php-on-the-backend/</guid>
		<description><![CDATA[<p>PHP (or any language for that matter) can just as easily be used as a daemon as on the web. This can be especially useful when solving problems that can&#8217;t &#8220;complete&#8221; in less than 500 ms which one shoots for on the web. As you write an application to handle things such as those <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/05/07/php-on-the-backend/">PHP on the Backend</a></span>]]></description>
			<content:encoded><![CDATA[<p>PHP (or any language for that matter) can just as easily be used as a daemon as on the web.  This can be especially useful when solving problems that can&#8217;t &#8220;complete&#8221; in less than 500 ms which one shoots for on the web.   As you write an application to handle things such as those mentioned below, be sensitive to the processing, disk space, and time needed to process these requests in planning how to handle these.  As an example jobs of a small size might be handled inline by the code that handles the form submission, but for larger jobs it queues them for background processing.  </p>
<p>great for background/async processing of:</p>
<ul>
<li>photos</li>
<li>movies</li>
<li>reports</li>
<li>imports of data</li>
</ul>
<p>advantages: </p>
<ul>
<li>use the same codebase as your app</li>
<li>use the same expertise on your team of programmers</li>
</ul>
<p>challenges:</p>
<ul>
<li>signals</li>
<li>one thread</li>
<li>memory (this will have to be a whole separate article)</li>
<li>starting and stopping</li>
</ul>
<p>A typical Daemon class I use:</p>
<pre>
abstract class Daemon {
    protected $done = false;

    public function __construct($argv) {
    }
    public function init() {
        pnctl_signal(SIGTERM, array($this, "onSignal"));
        pnctl_signal(SIGINT, array($this, "onSignal"));

    }
    abstract public function run();
    public function shutdown() {}
    public function isDone() {
        return $this->done;
    }
    public onSignal($signal){
        switch ($signal) {
             case SIGTERM:
             case SIGINT:
                $this->done = true;
                 break;
             default:
                 // handle all other signals
        }
    }
}</pre>
<p>As you can see, we&#8217;ve started to tackle some of the challenges here.  The idea is to handle signals, specifically I usually care about SIGTERM (default when using &#8216;kill&#8217; on *nix) and SIGINT (from pressing Ctrl-C).  Both will cause the program to exit gracefully.</p>
<p>I&#8217;ll be posting the class I use to run Daemon&#8217;s tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/05/07/php-on-the-backend/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TriPUG and MySQL Talk on Memcache and PHP</title>
		<link>http://www.davidrasch.com/2007/05/03/tripug-and-mysql-post-on-memcache-and-php/</link>
		<comments>http://www.davidrasch.com/2007/05/03/tripug-and-mysql-post-on-memcache-and-php/#comments</comments>
		<pubDate>Fri, 04 May 2007 01:03:45 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[memcache]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/05/03/tripug-and-mysql-post-on-memcache-and-php/</guid>
		<description><![CDATA[<p>Memcache is an extension written by Danga for simple Key/Value pair caching for use with your favorite programming language. In this talk I demonstrate how to install, integrate, and leverage Memcache in PHP (using MySQL for a database). I build a sample application, demonstrate less than desirable performance and finally, return performance with a <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/05/03/tripug-and-mysql-post-on-memcache-and-php/">TriPUG and MySQL Talk on Memcache and PHP</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danga.com/memcached/">Memcache</a> is an extension written by Danga for simple Key/Value pair caching for use with your favorite programming language.  In this <a href="http://www.davidrasch.com/talks/2007-05-memcache/">talk</a> I demonstrate how to install, integrate, and leverage Memcache in PHP (using MySQL for a database).  I build a sample application, demonstrate less than desirable performance and finally, return performance with a 100x improvement.</p>
<p>The whole talk and its supporting files can also be <a href="http://www.davidrasch.com/talks/2007-05-memcache/2007-05-memcache.zip">downloaded</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/05/03/tripug-and-mysql-post-on-memcache-and-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ditched the Zend Framework</title>
		<link>http://www.davidrasch.com/2007/03/19/ditched-the-zend-framework/</link>
		<comments>http://www.davidrasch.com/2007/03/19/ditched-the-zend-framework/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 01:41:00 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[sadface]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/03/19/ditched-the-zend-framework/</guid>
		<description><![CDATA[<p>I&#8217;ve ditched the Zend Framework on a project. In it&#8217;s place, Symfony has allowed me to recreate all the work with the Zend Framework over several months in a matter of 4 hours. </p> <p>The Zend Framework proved to be:</p> too piecemeal incomplete &#8211; arguably this is represented by the version number; but this <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/03/19/ditched-the-zend-framework/">ditched the Zend Framework</a></span>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve ditched the Zend Framework on a project.  In it&#8217;s place, Symfony has allowed me to recreate all the work with the Zend Framework over several months in a matter of 4 hours.  </p>
<p>The Zend Framework proved to be:</p>
<ul>
<li>too piecemeal</li>
<li>incomplete &#8211; arguably this is represented by the version number; but this applied to both individual components being incomplete and the lack of a complete offering for a whole application</li>
<li>in flux &#8211; changing each time we updated such that it was difficult to get the newer components without breaking lots of our code</li>
<li>too rigid &#8211; we found it far too rigid and requiring much code diving, without much direction, to redirect some of the logic especially in the Controller framework </li>
</ul>
<p>All in all, Symfony has proved very easy to use, and has many facets and components I haven&#8217;t yet even been able to take advantage of.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/03/19/ditched-the-zend-framework/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework and PDO_MYSQL</title>
		<link>http://www.davidrasch.com/2007/02/06/zend-framework-and-pdo_mysql/</link>
		<comments>http://www.davidrasch.com/2007/02/06/zend-framework-and-pdo_mysql/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 03:35:58 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2007/02/06/zend-framework-and-pdo_mysql/</guid>
		<description><![CDATA[<p>I&#8217;ve been working with the Zend Framework a bit and in working with MySQL through PDO_MYSQL. I&#8217;ve run into a few problems trying to use parameters of queries.</p> <p>I&#8217;ve narrowed the issue down to PDO itself and not the Zend Framework.</p> <p> $dbh = new PDO("mysql:host=localhost;dbname=db","user","pw"); $query = "insert into silo_test_data (record_id, fieldname, value) <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2007/02/06/zend-framework-and-pdo_mysql/">Zend Framework and PDO_MYSQL</a></span>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with the Zend Framework a bit and in working with MySQL through PDO_MYSQL.  I&#8217;ve run into a few problems trying to use parameters of queries.</p>
<p>I&#8217;ve narrowed the issue down to PDO itself and not the Zend Framework.</p>
<p><code><br />
$dbh = new PDO("mysql:host=localhost;dbname=db","user","pw");<br />
$query = "insert into silo_test_data (record_id, fieldname, value)<br />
               values (3,'stufftest', :value )";<br />
$handle = $dbh->prepare($query);<br />
$handle->execute(array(":value" => 'crap'));<br />
$dbh = null;<br />
</code></p>
<p>The value gets inserted into the database as an empty string, or sometimes some low-value bytes.  I&#8217;ve managed to work around this temporarily thanks to some help from <a href="http://netevil.org/node.php?nid=795&#038;SC=1">this post</a>.  By setting PDO to emulate prepared statements, everything seems to work okay.</p>
<p><code><br />
$dbh->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);<br />
</code></p>
<p>The problem is, the Zend framework encapsulates the actual db connection and connects lazily.  So, for now I&#8217;m running a query and then set the parameter on the encapsulated connection object.</p>
<p><code><br />
$db_connect = array( 'host' => $config->db->hostname,<br />
    'username' => $config->db->username,<br />
    'password' => $config->db->password,<br />
    'dbname' => $config->db->database );<br />
$db = Zend_Db::factory('PDO_MYSQL', $db_connect);<br />
$db->query('select 1');//HACK HACK HACK HACK to initiate connection.  Can't I make this a plugin?  or extend the class?<br />
$db->getConnection()->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);<br />
Zend::register('db',$db);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2007/02/06/zend-framework-and-pdo_mysql/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>don&#8217;t eat paste (learning PHP part iii)</title>
		<link>http://www.davidrasch.com/2006/10/16/dont-eat-paste-learning-php-part-iii/</link>
		<comments>http://www.davidrasch.com/2006/10/16/dont-eat-paste-learning-php-part-iii/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 03:26:44 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[learning php]]></category>
		<category><![CDATA[php books]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2006/10/16/dont-eat-paste-learning-php-part-iii/</guid>
		<description><![CDATA[<p>Hi, David. This is an interesting approach, but I think it’s a solution to a slightly different problem than teaching someone PHP. Instead, it’s a solution to teaching someone the basics of building a web app and you just happen to use PHP to teach those concepts. A perfectly worthwhile and desirable goal, but <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2006/10/16/dont-eat-paste-learning-php-part-iii/">don&#8217;t eat paste (learning PHP part iii)</a></span>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Hi, David. This is an interesting approach, but I think it’s a solution to a slightly different problem than teaching someone PHP. Instead, it’s a solution to teaching someone the basics of building a web app and you just happen to use PHP to teach those concepts. A perfectly worthwhile and desirable goal, but different.<br />
&#8230;
</p></blockquote>
<p><a href="http://www.davidrasch.com/2006/10/12/learning-sheltered-php-sans-bad-habits/#comment-333"><em>David Sklar</em></a></p>
<p>I agree and disagree with some of the points Sklar (sorry, two David&#8217;s makes this confusing) goes on to make.  If I may paraphrase, Sklar is raising a point which competes with that raised by <a href="http://benramsey.com/?p=166">Ben</a> in our initial discussion.  My initial suggestion in the discussion with Ben indicated that books should start by teaching PHP on the command-line and slowly build up to constructing a very lightweight MVC framework and example application.   One of Ben&#8217;s chief, and valid, concerns equated selling books about PHP with convincing readers or page-flippers that the book would teach them to build web pages in the first few chapters.  Or that individuals might be turned off if they weren&#8217;t creating XSS attacks willy-nilly by chapter 3.  I think the counter to this that Sklar raised is that by hiding the framework you turn off the people who don&#8217;t feel they&#8217;re really getting their feet wet with PHP.  They feel that by using your framework they aren&#8217;t learning the &#8216;real guts&#8217; of the language.  </p>
<p>This clearly relates directly to some of the arguments Sklar makes that other languages face this challenge as well, but PHP perhaps more so than others.  PHP digs its own hole here because unlike a .NET, Java, or a ColdFusion, PHP has built its name on easy to learn and get going.  You can pay $4.99/month and get a server running PHP in 10 minutes.  Writing an application in any of these other platforms can take orders of magnitude longer to setup, there&#8217;s an expectation of barrier to entry for learning, and often you have to buy pieces of it like an IDE.  Sklar indicates that it&#8217;s important to strike the balance between &#8220;a way to do things&#8221; and &#8220;the way to do things&#8221;. </p>
<p>The dilemma lies in choosing whether I ask the reader to take on faith that the framework underlying the first half of the book isn&#8217;t worth delving into right now, but is worth understanding later and either using the quick framework or garner enough knowledge of the principles to build your own.  Or, do I go back to my original plan of introducing PHP on the command-line as we built up a small framework and graduate up to a web page far later in the book.  </p>
<p>I have full confidence that either approach might work.  I know universities teach Physics both with and without calculus to which I&#8217;m sure the physics professors initially said &#8220;you can&#8217;t teach physics without calculus, it&#8217;s heresy!&#8221;  But, this day in age there&#8217;s only one physics.   I know my economics professor told me she didn&#8217;t like math, but she managed to teach a great class about economics concepts by moving lines back and forth on graphs.  </p>
<p>[tags]learning php, programming, computer science, php, php books[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2006/10/16/dont-eat-paste-learning-php-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API Access to Users&#8217; Data</title>
		<link>http://www.davidrasch.com/2006/10/01/api-access-to-users-data/</link>
		<comments>http://www.davidrasch.com/2006/10/01/api-access-to-users-data/#comments</comments>
		<pubDate>Mon, 02 Oct 2006 03:06:18 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2006/10/01/api-access-to-users-data/</guid>
		<description><![CDATA[<p>Apparently our API discussion at PHP Appalachia struck quite a chord with Michael. </p> <p>As we&#8217;re in the process of building up the IntelliContact API, we&#8217;ve run into this same problem. We&#8217;ve taken a bit of a simple solution. We allow a given user to associate an API key with their account and specify <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2006/10/01/api-access-to-users-data/">API Access to Users&#8217; Data</a></span>]]></description>
			<content:encoded><![CDATA[<p>Apparently our API discussion at PHP Appalachia struck quite a <a href="http://fosterburgess.com/kimsal/?p=136">chord with Michael</a>.  </p>
<p>As we&#8217;re in the process of building up the IntelliContact API, we&#8217;ve run into this same problem.  We&#8217;ve taken a bit of a simple solution.  We allow a given user to associate an API key with their account and specify a separate password.  This allows the application using the API to access only users accounts to which they&#8217;ve been granted, and leaves the power with the user to revoke the access at will by changing the password or disabling the API key access entirely.  This seems to be a simple-end solution to what Michael proposes which allows for a more general ACL.</p>
<p>[tags]API, REST, authentication[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2006/10/01/api-access-to-users-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Appalachia</title>
		<link>http://www.davidrasch.com/2006/09/30/php-appalachia/</link>
		<comments>http://www.davidrasch.com/2006/09/30/php-appalachia/#comments</comments>
		<pubDate>Sun, 01 Oct 2006 04:26:34 +0000</pubDate>
		<dc:creator>drasch</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://www.davidrasch.com/2006/09/30/php-appalachia/</guid>
		<description><![CDATA[<p> Brian and I went to PHP Appalachia this Wednesday and Thursday. Different from a traditional conference, the Cherokee, NC KOA served as the main venue for PHP Appalachia. The two of us stayed in a Kabin with a full bed and a set of bunks. All of us hiked, chatted, and met with <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.davidrasch.com/2006/09/30/php-appalachia/">PHP Appalachia</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/73037677@N00/256787532"><img width="255" height="191" align="right" src="http://static.flickr.com/90/256787532_029e960dd9.jpg?v=0" /></a> Brian and I went to <a href="http://www.phpappalachia.org">PHP Appalachia</a> this Wednesday and Thursday.  Different from a traditional conference, the Cherokee, NC KOA served as the main venue for PHP Appalachia.  The two of us stayed in a Kabin with a full bed and a set of bunks.  All of us hiked, chatted, and met with the other attendees until we left mid-day on Thursday.</p>
<p>We sat around the fire on Wednesday night chatting about PHP when Ben Ramsey and I entered an interesting discussion about PHP&#8217;s future and how to introduce newbies to PHP.</p>
<p>I&#8217;ll define the sterotype which serves as the premise for this discussion. Most books that introduce PHP, even those which rely on previous programming knowledge begin with an example like this:
<pre class="brush: php; title: ;">print &quot;hello world&quot;;</pre>
<p>   This example will be soon followed within the next 1-3 chapters (sometimes after, sometimes before introducing loops, conditions, and other basic language constructs of PHP) by an example like this:
<pre class="brush: php; title: ;">print $_GET['foo'];</pre>
<p>  In any/all books it&#8217;s far later in the book where Object-Oriented programming is covered.  In the coverage of creating forms, handling GET/POST/Cookies/Session there&#8217;s relatively little talk of security, escaping, or encodings.  </p>
<p>The long and short is that people learn PHP in a way that first teaches them to design web applications in a  poorly maintainable, insecure, and generally poor method.  With the advent frameworks like the Zend Framework and other MVC-based libraries there&#8217;s no need to teach bad habits that result in a bad name for PHP.  </p>
<p>[tags]php, books, rant[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.davidrasch.com/2006/09/30/php-appalachia/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

