<?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:34:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHP in Action Blog: Flash Messages]]></title>
      <guid>http://www.phpdeveloper.org/news/10323</guid>
      <link>http://www.phpdeveloper.org/news/10323</link>
      <description><![CDATA[<p>
On the PHP in Action blog <i>Dagfinn Reiersol</i> <a href="http://www.reiersol.com/blog/1_php_in_action/archive/41_flash_messages.html">shares a method</a> to send messages across a POST request that's followed by a redirect (versus a simple GET where it can be in the URL).
</p>
<blockquote>
When processing a GET request, you can display whatever messages you want. The most simplistic way is to echo them directly; or if just slightly more sophisticated, set it in the template that's about to become the web page. When processing a POST request that is to be followed by a redirect, you can't do that. The response (redirect) sent back to the browser does not have any text or HTML content.
</blockquote>
<p>
He points out two different ways to handle the problem - either manually append the message to the URL you're redirecting to or (a bit better method) store it in a session variable and remove it once its done. Several frameworks call this a "flash message". He gives examples of how to set this in two popular frameworks - <a href="http://framework.zend.com">Zend Framework</a> and <a href="http://cakephp.org">CakePHP</a>.
</p>]]></description>
      <pubDate>Mon, 02 Jun 2008 13:44:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP in Action Blog: Flash messages]]></title>
      <guid>http://www.phpdeveloper.org/news/10322</guid>
      <link>http://www.phpdeveloper.org/news/10322</link>
      <description><![CDATA[<p>
On the PHP in Action blog <i>Dagfinn Reiersol</i> shares a method to send messages across a POST request that's followed by a redirect (versus a simple GET where it can be in the URL).
</p>
<blockquote>
When processing a GET request, you can display whatever messages you want. The most simplistic way is to echo them directly; or if just slightly more sophisticated, set it in the template that's about to become the web page. When processing a POST request that is to be followed by a redirect, you can't do that. The response (redirect) sent back to the browser does not have any text or HTML content.
</blockquote>
<p>
He points out two different ways to handle the problem - either manually append the message to the URL you're redirecting to or (a bit better method) store it in a session variable and remove it once its done. Several frameworks call this a "flash message". He gives examples of how to set this in two popular frameworks - Zend Framework and CakePHP.
</p>]]></description>
      <pubDate>Mon, 02 Jun 2008 07:56:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ben Ramsey's Blog: Supporting PUT & DELETE in the Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/9719</guid>
      <link>http://www.phpdeveloper.org/news/9719</link>
      <description><![CDATA[<p>
<i>Ben Ramsey</i> has <a href="http://benramsey.com/archives/supporting-put-delete-in-the-zend-framework/">recently blogged about</a> some of the research and bit of development that he's done to add "more correct" functionality to the Zend Framework for working with RESTful interfaces - proper PUT and DELETE support.
</p>
<blockquote>
I've recently been wrapped up in an effort to design and implement a RESTful API using the Atom Protocol for a project at work. We are using the Zend Framework as the underlying framework for the project, so, in order to follow the Atom Protocol, I needed to support the HTTP methods PUT and DELETE
</blockquote>
<p>
Since the Zend Framework has been playing such a prominent role in the development, he's been digging into the Zend_Rest_Server component code and isn't too happy about its support for PUT and DELETE. As a result, he's proposed methods that might help resolve things such as isGet, isDelete, isOptions and getEntityBody. He' even created <a href="http://framework.zend.com/issues/browse/ZF-2723">a patch</a> to make the needed changes.
</p>]]></description>
      <pubDate>Thu, 28 Feb 2008 10:27:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Stoyan Stefanov's Blog: Simultaneous HTTP requests in PHP with cURL]]></title>
      <guid>http://www.phpdeveloper.org/news/9660</guid>
      <link>http://www.phpdeveloper.org/news/9660</link>
      <description><![CDATA[<p>
On his blog today, <i>Stoyan Stefanov</i> has <a href="http://www.phpied.com/simultaneuos-http-requests-in-php-with-curl/">a howto posted</a> on a trick he figured out to get a PHP script to grab data from multiple resources at one time - with cURL.
</p>
<blockquote>
The basic idea of a Web 2.0-style "mashup" is that you consume data from several services, often from different providers and combine them in interesting ways. This means you often need to do more than one HTTP request to a service or services. [...] Using the curl_multi* family of cURL functions you can make those requests simultaneously. This way your app is as slow as the slowest request, as opposed to the sum of all requests. And that's something.
</blockquote>
<p>
He <a href="http://www.phpied.com/simultaneuos-http-requests-in-php-with-curl/">includes example code</a> that loops through a given array of resources and executes the fetch, brining the results back into a result array. To illustrate, he also includes two types of examples of fetching content - one for GET and another for POST.
</p>]]></description>
      <pubDate>Tue, 19 Feb 2008 09:34:00 -0600</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>
    <item>
      <title><![CDATA[Larry Garfield's Blog: Benchmarking magic]]></title>
      <guid>http://www.phpdeveloper.org/news/9005</guid>
      <link>http://www.phpdeveloper.org/news/9005</link>
      <description><![CDATA[<p>
<i>Larry Garfield</i> has <a href="http://www.garfieldtech.com/blog/magic-benchmarks">put together some benchmarks</a> based around a request he had from other developers (the "performance czars") as to how the magic functions in PHP5 would perform in the new environment.
</p>
<blockquote>
Already, there is talk of how, and if, to leverage PHP 5's object handling now that we don't need to deal with the weirdness of PHP 4's object model. Of course, because it's Drupal, our army of performance czars want to know just what the cost is for object handling, and especially advanced object magic like __get(), __call(), the ArrayAccess interface, and so forth.
</blockquote>
<p>
He an <a href="http://www.garfieldtech.com/blog/magic-benchmarks">his tests</a> on a Thinkpad (Intel Core2 Duo 2.2Ghz) running Kubuntu and PHP 5.2.3. They were run two million times benchmarking the different methods for:
<ul>
<li>function calls 
<li>__call
<li>__get
<li>__set
<li>iterators (array)
<li>inheritance
<li>composition
</ul>
<p>
His results are listed at the <a href="http://www.garfieldtech.com/blog/magic-benchmarks">end of the post</a>.
</p>]]></description>
      <pubDate>Thu, 08 Nov 2007 12:04:00 -0600</pubDate>
    </item>
  </channel>
</rss>
