<?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>The Suburban Chicago PHP &#38; Web Development Meetup &#187; php</title>
	<atom:link href="http://suburbanchicagophp.org/archives/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://suburbanchicagophp.org</link>
	<description>A monthly gathering of web professionals</description>
	<lastBuildDate>Sun, 29 Aug 2010 14:22:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>PHP is getting closures!</title>
		<link>http://suburbanchicagophp.org/archives/47</link>
		<comments>http://suburbanchicagophp.org/archives/47#comments</comments>
		<pubDate>Tue, 22 Jul 2008 12:51:48 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[Language features]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[closures]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[lamba]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<guid isPermaLink="false">http://suburbanchicagophp.org/?p=47</guid>
		<description><![CDATA[I&#8217;ve seen very little from PHP that got me excited lately.  So, imagine how excited I am to hear that closures are coming to PHP 5.3! If you&#8217;ve done a lot with today&#8217;s popular Javascript libraries like jQuery and Prototype, you&#8217;ve no doubt come across closures.  They&#8217;re little self-contained functions that can be passed around [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen very little from PHP that got me excited lately.  So, imagine how excited I am to hear that <a href="http://www.toosweettobesour.com/2008/07/21/php-53-and-closures/">closures are coming to PHP 5.3</a>!</p>
<p>If you&#8217;ve done a lot with today&#8217;s popular Javascript libraries like jQuery and Prototype, you&#8217;ve no doubt come across closures.  They&#8217;re little self-contained functions that can be passed around like variables.  For example, jQuery&#8217;s fadeIn() method takes a function as its second parameter, and calls it when the target has faded in.  With a traditional coding style, you may have written something like this:</p>
<p> <code>
<pre>
function doStuff1()
{
	// do some stuff...
	$('#mydiv').fadeIn('normal', doStuff2);
	// do some more stuff...
}
function doStuff2()
{
	echo "hello world!";
}
</pre>
<p></code></p>
<p>This works, but there&#8217;s a visual disconnect between what happens in the middle of doStuff1() and what happens in doStuff2().  And, when you start reading doStuff2(), you don&#8217;t have any context for what&#8217;s happening (unless you left really good comments).  If doStuff2() is used in more than one place, you have a justification for keeping it a separate function.  But if it&#8217;s only used this one time, a closure is the way to go:</p>
<p><code>
<pre>
function doStuff1()
{
	// do some stuff...
	$('#mydiv').fadeIn('normal', function() {
		echo "hello world!";
	});
	// do some more stuff...
}
</pre>
<p></code></p>
<p>This code is more compact, and it makes it clear that the echo statement is related to the fadeIn() call.</p>
<p>I use closures a lot in my Javascript coding, and I&#8217;m sure I&#8217;ll be using them a lot in PHP once 5.3 is widespread.</p>
]]></content:encoded>
			<wfw:commentRss>http://suburbanchicagophp.org/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tonight&#8217;s Presentation &#8212; Caching</title>
		<link>http://suburbanchicagophp.org/archives/28</link>
		<comments>http://suburbanchicagophp.org/archives/28#comments</comments>
		<pubDate>Thu, 07 Feb 2008 18:57:42 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[Presentation]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://suburbanchicagophp.org/?p=28</guid>
		<description><![CDATA[Here&#8217;s my presentation for tonight, in case you don&#8217;t feel like going out in the snow&#8230; &#124; View &#124; Upload your own]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my presentation for tonight, in case you don&#8217;t feel like going out in the snow&#8230;</p>
<div style="width:425px;text-align:left" id="__ss_256828"><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=caching-data-for-performance-1202410239849020-4"/><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=caching-data-for-performance-1202410239849020-4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"><a href="http://www.slideshare.net/?src=embed"><img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare"/></a> | <a href="http://www.slideshare.net/csixty4/caching-data-for-performance?src=embed" title="View 'Caching Data For Performance' on SlideShare">View</a> | <a href="http://www.slideshare.net/upload?src=embed">Upload your own</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://suburbanchicagophp.org/archives/28/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Massive SQL injection attack</title>
		<link>http://suburbanchicagophp.org/archives/24</link>
		<comments>http://suburbanchicagophp.org/archives/24#comments</comments>
		<pubDate>Wed, 09 Jan 2008 06:30:05 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[prepared statements]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[SQL injection]]></category>
		<guid isPermaLink="false">http://suburbanchicagophp.org/?p=24</guid>
		<description><![CDATA[In case you didn&#8217;t see the news, tens of thousands of web sites were hacked to infect visitors and hijack their PCs. The sites were apparently modified by a script that found SQL injection vulnerabilities in sites and used them to add its own code to, well, pretty much every field on every record in [...]]]></description>
			<content:encoded><![CDATA[<p>In case you didn&#8217;t see the news, <a href="http://http://www.computerworld.com.au/index.php/id;683627551">tens of thousands of web sites</a> were hacked to infect visitors and hijack their PCs.  The sites were apparently modified by a script that found SQL injection vulnerabilities in sites and used them to add its own code to, well, pretty much every field on every record in the database, hoping one of those fields would be part of the site&#8217;s content.</p>
<p>SQL injection is one of the biggest security problems in the PHP world.  But, it doesn&#8217;t have to be a problem.</p>
<p>The simplest thing you can do to prevent SQL injection is to sanitize your inputs.  If you&#8217;re expecting an integer, check that the value is an integer before you plug it into your query.  Some people suggest using the addslashes() function on any value you plug into a query, but that <a href="http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string">still leaves room for improvement</a>.  The <a href="http://us3.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a> function provides a little better security.</p>
<p>An even better way to thwart SQL injection is through prepared statements.  They&#8217;re supported by the <a href="http://pear.php.net/package/MDB2">MDB2</a> library from the PEAR project, and I&#8217;m sure many other libraries support them.  A prepared statement query looks something like this:</p>
<p><code>SELECT * FROM users WHERE username = ?</code></p>
<p>When you run the query, you give the database library a list of values to match up with the ?s in the prepared statement.  The library then passes those values to the database, saying &#8220;I want you to find this exact value.  Don&#8217;t interpret it, just look for this value verbatim.&#8221;  If someone tries SQL injection against a prepared statement, they&#8217;re just going to get 0 results back.</p>
<p>Sure, there&#8217;s a performance penalty for doing prepared statements, but the security benefits are well worth the overhead.  You don&#8217;t want your site to be one of the &#8220;tens of thousands&#8221; infecting other people&#8217;s PCs, now, do you?</p>
<hr />Edit: modsecurity.org has <a href="http://www.modsecurity.org/blog/archives/2008/01/sql_injection_a.html">the query string</a> used in this attack, and information on how the mod_security Apache module can filter out attacks like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://suburbanchicagophp.org/archives/24/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Poll: What topic(s) would you like to see discussed at a Meetup?</title>
		<link>http://suburbanchicagophp.org/archives/20</link>
		<comments>http://suburbanchicagophp.org/archives/20#comments</comments>
		<pubDate>Tue, 11 Dec 2007 00:49:48 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[Meetup]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[poll]]></category>
		<guid isPermaLink="false">http://suburbanchicagophp.org/?p=20</guid>
		<description><![CDATA[I set up a poll in the sidebar at suburbanchicagophp.org.  Stop by and vote for what you&#8217;d like to see presented/discussed at future meetups!]]></description>
			<content:encoded><![CDATA[<p>I set up a poll in the sidebar at <a href="http://www.suburbanchicagophp.org">suburbanchicagophp.org</a>.  Stop by and vote for what you&#8217;d like to see presented/discussed at future meetups!</p>
]]></content:encoded>
			<wfw:commentRss>http://suburbanchicagophp.org/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dave’s (Poignant) Guide to PHP</title>
		<link>http://suburbanchicagophp.org/archives/19</link>
		<comments>http://suburbanchicagophp.org/archives/19#comments</comments>
		<pubDate>Sun, 02 Dec 2007 08:17:33 +0000</pubDate>
		<dc:creator>dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[chunky bacon]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<guid isPermaLink="false">http://suburbanchicagophp.org/?p=19</guid>
		<description><![CDATA[I wish I had bookmarked a blog entry I read this morning on how PHP is a dead language for everyone except $7.95/mo web hosts. I certainly don&#8217;t see that as the case, but I may be biased being a PHP developer with an overly full workload who knows a bunch of people who like [...]]]></description>
			<content:encoded><![CDATA[<p>I wish I had bookmarked a blog entry I read this morning on how PHP is a dead language for everyone except $7.95/mo web hosts.  I certainly don&#8217;t see that as the case, but I may be biased being a PHP developer with an overly full workload who knows a bunch of people who like and use PHP.  I&#8217;ve given some thought to the future of PHP, though, and I have to agree it&#8217;s on the way out, but only in the same sense that Java is on the way out.</p>
<p>Java is still out there, and I get tons of calls &amp; emails from recruiters every week looking to fill Java positions (even though I haven&#8217;t updated my online resume in over a year).  Java positions tend to pay well, and are usually with big, dependable companies. They&#8217;re safe, but probably not very &#8220;fun&#8221;.  Very few new open source projects are written in Java &#8212; that&#8217;s not where the action is anymore.  Likewise, PHP <a href="http://www.php.net/history">started out as a hobbyist thing</a> but grew into a language used by Google, Yahoo!, and other big names on the Internet.  PHP is where Java was a year or two ago.  Python is where PHP was a year or two ago, and Ruby is where Python was back then.</p>
<p>With one company (Zend) dominating the community like they do, and with big companies using it, PHP seems to have become kinda &#8220;corporate&#8221;.  Remember when your favorite band signed with a big label?  PHP kind of did that.  The indie fans who dug its original sound and obscurity have moved on to other cool &amp; obscure languages.  The sound changed, man.  It used to be about the music, man, but now it&#8217;s all about writing songs for yuppies to listen to while they drink their lattes in their BMWs!</p>
<p>Ok, this metaphor is getting out of hand.  But, you get where I&#8217;m going with this, right?</p>
<p>Ruby and Haskell are the big &#8220;indie&#8221; programming languages these days.  The <a href="http://blog.red-bean.com/sussman/?p=79">20% kind of programmers</a> see them pushing the boundaries and breaking us out of the C++/Java influenced paradigms which have dominated for more than a decade.  They&#8217;re the programming languages of rebels&#8230;digital Che Guevara t-shirts, if you will.</p>
<p>Know what else they&#8217;ve got?  Why the Lucky Stiff.</p>
<p><a href="http://suburbanchicagophp.org/wp-content/uploads/2007/12/thefoxes-6.png" title="Cartoon foxes"><img src="http://suburbanchicagophp.org/wp-content/uploads/2007/12/thefoxes-6.png" alt="Cartoon foxes" /></a></p>
<p><a href="http://poignantguide.net/ruby/whatisit.html">Why&#8217;s (Poignant) Guide to Ruby</a> is a programming book, the likes of which I haven&#8217;t seen since <a href="http://www.mrbunny.com/index.html">Mr. Bunny&#8217;s Big Cup o&#8217; Java</a> back in &#8217;99.  It teaches the basics of Ruby programming through surreal cartoons, personal anecdotes (usually not about programming), and code examples.  It&#8217;s fun, it&#8217;s catchy (chunky bacon!), and it&#8217;s unlike any book I&#8217;ve seen the PHP community produce.  It&#8217;s even published online with a Creative Commons license, for that extra bit of indie cred.</p>
<p>Think what you will of a programming book written in this style, but you have to admit that it&#8217;s &#8220;out there&#8221;.  It&#8217;s different, and that makes it attractive.  PHP doesn&#8217;t have Why the Lucky Stiff.  We have Zend.  And, while I&#8217;m sure the Zend crew knows how to party, their website doesn&#8217;t reflect it.   When you&#8217;re pushing a $250/seat IDE, it has to look attractive to the kind of people who cut checks to order $250/seat IDEs, not the kind of people who stay up into the wee hours of the morning learning new programming languages.</p>
<p>I&#8217;m not saying we should go out and  steal this idea, but maybe ask ourselves why the PHP community doesn&#8217;t have a Why, and what might prevent us from having one in the future.  If the answer involves the words &#8220;management&#8221;, &#8220;corporate&#8221;, or &#8220;inappropriate&#8221;, we&#8217;re doomed.  Now that PHP 5.x is coming into it&#8217;s own, attention will be focussed on PHP 6.x for a <a href="http://it.slashdot.org/article.pl?sid=06/03/14/0455221">glimpse of what the future holds</a>.  If PHP is to remain popular among the passionate programmers out there, it needs to catch up feature-wise.  I, for one, dislike writing complex apps in a language that doesn&#8217;t have namespaces.  It also needs to start pushing boundaries.</p>
<p>If PHP &#8220;sells out&#8221;, it wont mean the immediate death of the language, community, or even the job market &#8212; Java has proven that.  But it will start it on the path of decline, and once you&#8217;re on that path it&#8217;s hard to get off it. We need to make PHP fun again.  PHP needs chunky bacon.</p>
]]></content:encoded>
			<wfw:commentRss>http://suburbanchicagophp.org/archives/19/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
