<?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, 19 May 2013 00:59:15 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Bob Majdak: Extending an Iterator to use an Iterator to make your code a little cleaner]]></title>
      <guid>http://www.phpdeveloper.org/news/19300</guid>
      <link>http://www.phpdeveloper.org/news/19300</link>
      <description><![CDATA[<p>
In <a href="http://catch404.net/2013/03/extending-an-iterator-to-use-an-iterator-to-make-your-code-a-little-cleaner/">this new post</a> to his site <i>Bob Majdak</i> talks about extending iterators to help make it easier to customize it for your needs.
</p>
<blockquote>
One of the nice things about iterators is the ability to shove them into other iterators, allowing you to wrap their functionality in other functionality to return a more precise result set. Take for example the idea that we want to read a directory to list only the images inside of it. There are two main ways to do this, via <a href="http://www.php.net/opendir>opendir</a> / <a href="http://www.php.net/readdir">readdir</a> functions and via <a href="http://www.php.net/FilesystemIterator">FilesystemIterator</a> objects. Going the FilesystemIterator route, one common way seems to be extend another class called <a href="http://www.php.net/FilterIterator">FilterIterator</a> which allows you to customize a filter based on you overwriting a method called accept().
</blockquote>
<p>
He shows not only overriding the "accept" method, but also the constructor to make using this new iterator a much simpler (and cleaner) call. You can find out more about the FilesystemIterator (and others) over in <a href="http://www.php.net/manual/en/spl.iterators.php">the Iterators section</a> of the PHP manual.
</p>]]></description>
      <pubDate>Tue, 12 Mar 2013 09:25:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jason Fox: Use the Accept Header to Set Your Return Data With Zend Framework 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19222</guid>
      <link>http://www.phpdeveloper.org/news/19222</link>
      <description><![CDATA[<p>
<i>Jason Fox</i> has a recent post to his site about using <a href="http://neverstopbuilding.net/use-the-accept-header-to-set-your-return-data-with-zend-framework-2/?utm_source=reddit">"Accept" headers in Zend Framework 2 apps</a> to set the format of the return data from a request.
</p>
<blockquote>
In this article I detail the process by which you can set up your controller actions in Zend Framework 2 to return either the default HTML, or JSON data depending on the "Accept Header" in the request. It incorporates changes related to a security update added since this <a href="http://akrabat.com/zend-framework-2/returning-json-using-the-accept-header-in-zf2/">very helpful article</a> was written, and expands on some of the intricacies of making your web layer objects better "json providers."
</blockquote>
<p>
His example uses a "ViewJsonStrategy" and the criteria to look for to determine which version to respond with (HTML or JSON) - the Accept header. It uses the JSON encoder/decoder instead of the built-in PHP one to he could use the included "toJson" method to customize the output of the JSON instead of just returning everything.
</p>]]></description>
      <pubDate>Fri, 22 Feb 2013 11:42:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect Blog: Professional Programming: DTAP - Part 1: What is DTAP?]]></title>
      <guid>http://www.phpdeveloper.org/news/12815</guid>
      <link>http://www.phpdeveloper.org/news/12815</link>
      <description><![CDATA[<p>
<i>Cal Evans</i> has posted <a href="http://phparch.com/main/news/view/34">the first part</a> of his look at DTAP - development, testing, acceptance and production - and how it applies to PHP development.
</p>
<blockquote>
There are four primary systems that need to be set up and isolated. And they are described by the acronym DTAP-Development, Testing, Acceptance, and Production. One thing that has changed recently, though, is that these systems no longer have to mean separate hardware. 
</blockquote>
<p>
He gives an overview of each, setting out definitions to be used for the rest of the series with the next part discussing some of the "smaller moving pieces" of the process.
</p>]]></description>
      <pubDate>Mon, 06 Jul 2009 20:23:54 -0500</pubDate>
    </item>
  </channel>
</rss>
