<?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>Thu, 23 May 2013 01:35:44 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: MongoDB Indexing, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19579</guid>
      <link>http://www.phpdeveloper.org/news/19579</link>
      <description><![CDATA[<p>
PHPMaster.com has posted part two of their series looking at indexing in MongoDB databases (<a href="http://phpdeveloper.org/news/19551">part one here</a>) with some <a href="http://phpmaster.com/mongodb-indexing-2">more advanced concepts</a> Mongo makes available.
</p>
<blockquote>
In <a href="http://phpmaster.com/mongodb-indexing-1/">part 1</a> of this series we had an introduction to indexing in MongoDB. we saw how to create, use, and analyze queries with indexes giving us a good foundation to build on. In this part, we'll take a look at a few more small but important concepts, like indexing on sub-documents and embedded fields, covered queries, and index direction.
</blockquote>
<p>
They use the same "posts" collection from the previous article, showing you how to index it based on a "location" sub document and "embedded fields" inside of it. They also touch on complex sorting with a multi-field index and the idea of "covered queries." These are queries that all fields queried are part of an index as well as all returned. They finish up the article by showing you how to remove indexes too.
</p>
Link: http://phpmaster.com/mongodb-indexing-2]]></description>
      <pubDate>Mon, 13 May 2013 10:36:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Christopher Martinez: Static code analysis tools for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19563</guid>
      <link>http://www.phpdeveloper.org/news/19563</link>
      <description><![CDATA[<p>
<I>Christopher Martinez</i> has a recent post to his site that covers some of the <a href="http://chrsm.org/2013/05/05/code-analysis-tools-for-php">static analysis tools available for PHP</a> including the PHP Mess Detector, PHP CodeSniffer and the PHP Analyzer.
</p>
<blockquote>
I believe in writing code that is easy to understand, easy to test, and easy to refactor. Yes, I realize that the statement above is pretty general and open to interpretation. Not everyone needs external tools to ensure quality in their code...but, I work on things from time to time that have absolutely no tests. [...] For whatever reason, this happens a lot more frequently in the PHP world. I'm guilty of not writing tests and checking how I write code, sometimes, too. Things are bright, though, for the PHP community - for quite some time now, we've had fantastic tools that assist us in writing better code. 
</blockquote>
<p>
He covers each of the tools, talks some about what they're good for and gives examples of their use, including output. He also talks some about the <a href="https://github.com/facebook/pfff">Pfff</a> set of tools created by Facebook. He also talks some about how these tools fit into his daily work as a part of his pre-commit hooks in git.
</p>
Link: http://chrsm.org/2013/05/05/code-analysis-tools-for-php]]></description>
      <pubDate>Wed, 08 May 2013 12:38:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: MongoDB Indexing, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/19551</guid>
      <link>http://www.phpdeveloper.org/news/19551</link>
      <description><![CDATA[<p>
New on PHPMaster.com is the first part of their series about <a href="http://phpmaster.com/mongodb-indexing-1/">indexing in MongoDB</a>, a method for optimizing your collections to make querying them even faster. They cover the five main types of indexes and situations where they can help.
</p>
<blockquote>
Indexing is one of the more important concepts of working with MongoDB. A proper understanding is critical because indexing can dramatically increase performance and throughput by reducing the number of full documents to be read, thereby increasing the performance of our application. Because indexes can be bit difficult to understand, this two-part series will take a closer look at them.
</blockquote>
<p>
They look at the default "_id" index, secondary, compound, multikey and multikey compound indexes. Example documents and results are included as well as some of the options that can be set on the index types to tweak performance. They finish up the article with a look at some of the limitations and considerations to think about when using indexing, including that they cannot be used with regex queries.
</p>
Link: http://phpmaster.com/mongodb-indexing-1]]></description>
      <pubDate>Mon, 06 May 2013 11:50:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Trying out PHP Refactoring Browser]]></title>
      <guid>http://www.phpdeveloper.org/news/19490</guid>
      <link>http://www.phpdeveloper.org/news/19490</link>
      <description><![CDATA[<p>
On DZone.com <i>Giorgio Sironi</i> has written up a post about <a href="http://css.dzone.com/articles/trying-out-php-refactoring">some testing he's done</a> with the ""PHP Refactoring Browser" (more on that <a href="http://phpdeveloper.org/news/19424">here</a>) on some basic code examples.
</p>
<blockquote>
IDE proponents love, in fact, an Integrated Development Environment that provides all the functionalities you need while writing and editing code; the followers of the Unix way typically write code in Vim while augmenting it via plugins where feasible and leveraging external tools that <a href="http://en.wikipedia.org/wiki/Unix_philosophy">do one thing, and do it well</a>. [...] Automated refactorings in PHP were out of the league of Vim and Unix users; thanks to Qafoo, however, a new open source tool is able to edit code with predefined refactoring recipes: PHP Refactoring Browser.
</blockquote>
<p>
He goes through some of the basic features and functionality of the browser, setting expectations a bit. He shows how to get it installed (via Composer) and the results of some of his testing. Rather than including them all in the post, he opted to <a href="https://github.com/giorgiosironi/prb-example/commits/master">make actual commits on github</a> of the changes.
</p>
Link: http://css.dzone.com/articles/trying-out-php-refactoring]]></description>
      <pubDate>Mon, 22 Apr 2013 10:03:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Benjamin Eberlei: Traits are Static Access]]></title>
      <guid>http://www.phpdeveloper.org/news/19453</guid>
      <link>http://www.phpdeveloper.org/news/19453</link>
      <description><![CDATA[<p>
In a new post to his site <i>Benjamin Eberlei</i> shares an opinion about traits, noting that they're <a href="http://www.whitewashing.de/2013/04/12/traits_are_static_access.html">basically the same as static functionality</a> when it comes to several things like coupling, not being testable and being a "global state" container.
</p>
<blockquote>
I used to look forward to traits as a feature in PHP 5.4, but after discussions with Kore I came to the conclusion that traits are nothing else than static access in disguise. They actually lead to the exact same code smells. Familiar with the outcome of too much static use, we should reject traits as just another way of statically coupling your code to other classes.
</blockquote>
<p>
He includes some code examples showing traits in use in an example controller to handle a simple redirect. He points out at least six different issues with just this simple implementation. He rewrites it as "static" code to help prove his point. He comes to the conclusion that, much like static methods, traits should be avoided and instead aggregation should be favored.
</p>
Link: http://www.whitewashing.de/2013/04/12/traits_are_static_access.html]]></description>
      <pubDate>Fri, 12 Apr 2013 11:16:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Anna Filina: Define: Functional, Unit and Integration Tests]]></title>
      <guid>http://www.phpdeveloper.org/news/19429</guid>
      <link>http://www.phpdeveloper.org/news/19429</link>
      <description><![CDATA[<p>
<i>Anna Filina</i> has a new post to her site that helps to clarify the definitions between <a href="http://annafilina.com/blog/functional-unit-and-integration-tests/">functional, unit and integrations tests</a> of your application's functionality.
</p>
<blockquote>
I have recently read a blog post claiming that functional tests are not "true" tests. The author also claims that unit testing shows you where the problem is occurring, while functional testing simply identifies that a problem exists. This argument is deceptive and the conclusion dangerous. Different kinds of tests are not mutually exclusive. One is not superior to the other. They have different goals and can happily coexist. Let me explain the kinds of tests so that you could make enlightened decisions.
</blockquote>
<p>
She covers each type of test in detail, noting the goal of that particular type and some examples of the kinds of things they might test. She starts with the highest level, functional testing, then jumps down to the lowest - unit testing. She finishes up the post defining "integration tests" as tests that ensure you're integrating correctly - that you're using the API provided by the tool in the right way and that it's working as expected.
</p>
Link: http://annafilina.com/blog/functional-unit-and-integration-tests]]></description>
      <pubDate>Mon, 08 Apr 2013 14:45:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Adam Bard: The Same App 4 Times: PHP vs Python vs Ruby vs Clojure]]></title>
      <guid>http://www.phpdeveloper.org/news/19370</guid>
      <link>http://www.phpdeveloper.org/news/19370</link>
      <description><![CDATA[<p>
<i>Adam Bard</i> has written up a post that takes the same small application (a "Nurblizer") and writes it as a web application <a href="http://adambard.com/blog/PHP-ruby-python-clojure-webapps-by-example/">in four different languages</a> - PHP, Python, Ruby and Clojure. His point is less about which is "best" but more to show the differences between them.
</p>
<blockquote>
Here's a toy program I wrote implemented in PHP, Python, Ruby, and Clojure. I hope it's helpful for someone who knows at least one of those and wants to learn another.
The program is called "Nurblizer", and it does one thing: Accept free-form text, and attempt to replace all words but the nouns in said text with the word "nurble". It's up and running at <a href="http://nurblizer.herokuapp.com">http://nurblizer.herokuapp.com</a>
</blockquote>
<p>
He includes the source for each language's version using Sinatra for Ruby and Flask for Python but for PHP and Clojure it's just straight code. For each he briefly explains what its doing and a bit about how it relates to the examples from the other languages. He also points out <a href="https://news.ycombinator.com/item?id=5440170">a Hacker News discussion</a> that's popped up about the examples.
</p>]]></description>
      <pubDate>Wed, 27 Mar 2013 09:13:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: A First Look at React]]></title>
      <guid>http://www.phpdeveloper.org/news/19365</guid>
      <link>http://www.phpdeveloper.org/news/19365</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial that <a href="http://phpmaster.com/a-first-look-at-react/">introduces you to React</a>, the PHP-based event-driven non-blocking socket tool that's similar to some of the functionality Node.js provides. The article is a very basic introduction but can help get your feet wet with the tool.
</p>
<blockquote>
For the past couple of years, <a href="http://nodejs.org/">Node.js</a> has been drawing increasing amounts of attention as a promising web technology. While it has some strengths, like being event driven, some people just want to stick to PHP. For over a year now, however, there has been a similar project for PHP named <a href="http://reactphp.org/">React</a>. React is mostly coded by <a href="https://igor.io/">Igor Wiedler</a>, who is also a prominent contributor to the <a href="https://github.com/fabpot/Silex">Silex framework</a>. While reading through the React examples, it really does look similar to Node.js.
</blockquote>
<p>
Included in the post are the instructions on how to get the latest version of React (via Composer) and the code to create a sample server that just writes out a string with a counter for the number of requests made. There's also an example of a "keystroke logger" for all data that's coming across the connection. The author (<i>Igor</i>) notes, however, that he wouldn't recommend using React in production, though, as its target is mostly those working with "cutting-edge technologies" rather than more stable applications.
</p>]]></description>
      <pubDate>Tue, 26 Mar 2013 10:01:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Setfive.com: PHP: Some thoughts on using array_* with closures]]></title>
      <guid>http://www.phpdeveloper.org/news/19331</guid>
      <link>http://www.phpdeveloper.org/news/19331</link>
      <description><![CDATA[<p>
On the Setfive site there's a recent post from <i>Ashish Datta</i> about <a href="http://shout.setfive.com/2013/03/18/php-some-thoughts-on-using-array_-with-closures/">some thoughts around array functions and closures</a> for callback methods.
</p>
<blockquote>
The other day, I was hacking away on the PHP backend for the "Startup Institute" visualization and I realized it was going to need a good deal of array manipulation. Figuring it was as good a time as any, I decided to try and leverage PHP 5.3+ new closures along with the array_* functions to manipulate the arrays. I'm not well versed with functional programming but I've used Underscore.js's array/collection functions so this is mostly in comparison to that.
</blockquote>
<p>
He gives a sample data set he's pulling from - basic user data - and goes through a few different actions that can be taken on the data (with code examples for each): sorting, mapping and filtering. He shows the use of closures as the callback methods instead of defining them separately and passing in their names. 
</p>]]></description>
      <pubDate>Tue, 19 Mar 2013 10:36:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Your One-Stop Guide to Laravel Commands]]></title>
      <guid>http://www.phpdeveloper.org/news/19257</guid>
      <link>http://www.phpdeveloper.org/news/19257</link>
      <description><![CDATA[<p>
Over on NetTuts.com today they've published a <a href="http://net.tutsplus.com/tutorials/php/your-one-stop-guide-to-laravel-commands">"one stop guide" to creating Laravel commands</a> that can make using the <a href="http://laravel.com">Laravel PHP framework</a> simpler. The format for these commands are more related to the <a href="http://four.laravel.com">Laravel 4</a> version of the framework (still in beta).
</p>
<blockquote>
In this day and age, it's quite normal for a developer to have an understanding of consoles, and how to issue basic commands. But what if you could code your own custom commands to improve your workflow? If we look back to Laravel 3, you might remember that it offered tasks. Tasks were extremely helpful, but still came up short for more complex operations. Thankfully, Laravel 4 packs a beefed up Artisan that will make your life as a developer so much easier!
</blockquote>
<p>
They start by introducing you to Artisan and what it can do already, then move into how you can create you own custom commands (with code examples). They show you how to add a description, coloring for the output, work with arguments, use confirm/question prompts and working with dependencies you might need.
</p>]]></description>
      <pubDate>Fri, 01 Mar 2013 10:56:44 -0600</pubDate>
    </item>
  </channel>
</rss>
