<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sun, 06 Jul 2008 16:51:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Global Variables and PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/10424</guid>
      <link>http://www.phpdeveloper.org/news/10424</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> has a <a href="http://sebastian-bergmann.de/archives/797-Global-Variables-and-PHPUnit.html">new post</a> today about a feature of the PHPUnit unit testing tool that has the possibility of breaking when objects are introduced - backing up the globals.
</p>
<blockquote>
It is hard to test code that uses singletons. The same is true for code that uses global variables. Typically, the code you want to test is coupled strongly with a global variable and you cannot control its creation. An additional problem is the fact that one test's change to a global variable might break another test.
</blockquote>
<p>
You can disable the backup option if you'd like by setting the $backupGlobals option in your test to false. This lets PHPUnit know that you want to leave the globals (and superglobals) alone during the run.
</p>]]></description>
      <pubDate>Tue, 17 Jun 2008 08:49:19 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Building File Uploaders with PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/9830</guid>
      <link>http://www.phpdeveloper.org/news/9830</link>
      <description><![CDATA[<p>
On DevShed today there's a <a href="http://www.devshed.com/c/a/PHP/Building-File-Uploaders-with-PHP-5/">new tutorial</a> showing how to build file upload functionality into your scripts.
</p>
<blockquote>
If you're a PHP developer who has built a certain number of web applications, then it's quite probable that you've already worked with HTTP file uploads. [...] First I'm going to teach you how to handle file uploads using a procedural approach, and then, with the topic well underway, by way of the object-oriented paradigm.
</blockquote>
<p>
The introduce the beginners out there to <a href="http://www.devshed.com/c/a/PHP/Building-File-Uploaders-with-PHP-5/1/">the $_FILES array</a> (a superglobal) that contains the details about the file(s) that have been submitted. Next comes the construction of a <a href="http://www.devshed.com/c/a/PHP/Building-File-Uploaders-with-PHP-5/2/">simple form</a> and how to handle the submission <a href="http://www.devshed.com/c/a/PHP/Building-File-Uploaders-with-PHP-5/3/">on the PHP side</a>.
</p>]]></description>
      <pubDate>Thu, 20 Mar 2008 11:18:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoyan Stefanov's Blog: PHP-style $GLOBALS in Javascript?]]></title>
      <guid>http://www.phpdeveloper.org/news/9780</guid>
      <link>http://www.phpdeveloper.org/news/9780</link>
      <description><![CDATA[<p>
In a <a href="http://www.phpied.com/php-style-globals-in-javascript/">new post</a> to his blog today, <i>Stoyan Stefanov</i> has a proposal to being something PHP users are very used to - superglobals - over to Javascript.
</p>
<blockquote>
Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. [...] In PHP on the other hand, variables are local. [...] So how about this: adopt the $GLOBALS convention in your JavaScripts?
</blockquote>
<p>
His <a href="http://www.phpied.com/php-style-globals-in-javascript/">example</a> proposes the creation of a GLOBALS object you can assign properties to that can be used anywhere. This helps to keep the variables you truely want to be global contained, though it doesn't do much except provide a convention.
</p>]]></description>
      <pubDate>Wed, 12 Mar 2008 07:55:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Moon's Blog: Responsible use of the $_REQUEST variable]]></title>
      <guid>http://www.phpdeveloper.org/news/9466</guid>
      <link>http://www.phpdeveloper.org/news/9466</link>
      <description><![CDATA[<p>
In one of his <a href="http://doughboy.wordpress.com/2008/01/17/responsible-use-of-the-_request-variable/">recent blog entries</a>, <i>Brian Moon</i> takes a look at what he considers the "proper use" of the PHP superglobal $_REQUEST (as brought on by <a href="http://marc.info/?l=php-internals&m=119956617516891&w=2">a thread</a> on the PHP internals mailing list.
</p>
<blockquote>
I have seen more than one person make the following logic mistake: I may get data via GET, I may get data via POST - Ah, I should use $_REQUEST as it will catch both.
</blockquote>
<p>
<i>Brian</i> points out the error - cookies aren't in $_REQUEST so improper handling of those values could lead to cookie data overwriting GET/POST data from $_REQUEST. Several of the comments on the post also warn against improper handling of the values, noting that doing so could lead to holes open for attacks (like session fixation).
</p>]]></description>
      <pubDate>Tue, 22 Jan 2008 09:38:00 -0600</pubDate>
    </item>
  </channel>
</rss>
