<?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, 12 Feb 2012 20:37:08 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPMaster.com: The Liskov Substitution Principle]]></title>
      <guid>http://www.phpdeveloper.org/news/17442</guid>
      <link>http://www.phpdeveloper.org/news/17442</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new post from <i>Alejandro Gervasio</i> about a part of the <a href="http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)">SOLID</a> development methods - the <a href="http://phpmaster.com/liskov-substitution-principle/">Liskov Substitution Principle</a> - the idea that objects should be replaceable with instances of their subtypes without a change to the architecture of the application.
</p>
<blockquote>
Even when the formal definition of the LSP makes eyes roll back (including mine), at its core it boils down to avoiding brittlely-defined class hierarchies where the descendants expose a behavior radically different from the base abstractions consuming the same contract.
</blockquote>
<p>
He includes an example with a "deleted scene" from the Matrix depicting an attempted override of the PDO functionality with a subclass that, unfortunately, does not match the original's structure/method definitions. The problem was in the difference between the method signature for the "query" method. It help resolve situations like this he recommends creating a "contract" in the form of an interface your code can implement, forcing it to conform to a certain structure. Using this, he provides a rewrite of the "PdoAdapter" class to match the original signature 
</p>]]></description>
      <pubDate>Tue, 24 Jan 2012 13:40:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: PHPUnit_Selenium]]></title>
      <guid>http://www.phpdeveloper.org/news/17424</guid>
      <link>http://www.phpdeveloper.org/news/17424</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has a quick tutorial showing you how to set up and use the <a href="http://css.dzone.com/articles/phpunitselenium">PHPUnit_Selenium</a> component in the latest releases of the <a href="http://phpunit.de">popular testing software</a>.
</p>
<blockquote>
With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel.
</blockquote>
<p>
He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.
</p>]]></description>
      <pubDate>Fri, 20 Jan 2012 09:12:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Playing with the new PHP5.4 features]]></title>
      <guid>http://www.phpdeveloper.org/news/17174</guid>
      <link>http://www.phpdeveloper.org/news/17174</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog today showing some of the <a href="http://gonzalo123.wordpress.com/2011/11/28/playing-with-the-new-php5-4-features/">experimentation he's done with PHP 5.4 features</a> like the short array syntax, calling methods through arrays and traits.
</p>
<blockquote>
PHP5.4 it's close and it's time to start playing with the new cool features. I've created a new Virtual Machine to play with the new features available within PHP5.4. I wrote a post with the most exciting features (at least for me) when I saw the feature list in the alpha version. Now the Release Candidate is with us, so it's the time of start playing with them. I also discover really cool features that I pass over in my first review.
</blockquote>
<p>Code snippets are included for each example for:</p>
<ul>
<li>Class member access on instantiation
<li>Short array syntax
<li>Support for Class::{expr}() syntax
<li>Indirect method call through array
<li>Callable typehint
<li>Traits
<li>Array dereferencing support
</ul>
<p>
He points to <a href="http://php.webtutor.pl/en/2011/09/27/whats-new-in-php-5-4-a-huge-list-of-major-changes/">this other post</a> for a complete list of what's been added in 5.4.
</p>]]></description>
      <pubDate>Mon, 28 Nov 2011 08:10:51 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ed Finkler's Blog: Building a Tumblelog with Gimme Bar and PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17093</guid>
      <link>http://www.phpdeveloper.org/news/17093</link>
      <description><![CDATA[<p>
<i>Ed Finkler</i> has a new post today showing how he's created a <a href="http://funkatron.com/posts/building-a-tumblelog-with-gimme-bar-and-php.html">tumbleblog using the Gimmie Bar API and backend</a> as a source for the posts. For the curious, the code for his simple blog can be <a href="https://github.com/funkatron/GimmeMe">found here</a>.
</p>
<blockquote>
One of the coolest things about working on <a href="http://gimmebar.com/">Gimme Bar</a> has been the opportunity to build a platform. While most folks interact with our service via the web site, the site is just one application built on top of the Gimme Bar content collection and curation system. Our web site interacts with the system via our <a href="https://gimmebar.com/api/v0">HTTP API</a>, which is open to everyone, not just our internal team. That means that anyone can build applications on top of our platform to suit their own needs or interests.
</blockquote>
<p>
This simple blog (<a href="http://funkatron.com/GimmeMe">demo here</a> grabs items from his Gimmie Bar feed and posts them. He includes complete installation instructions and a brief overview of how the parts work together.
</p>]]></description>
      <pubDate>Mon, 07 Nov 2011 10:47:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Closure Object Binding in PHP 5.4]]></title>
      <guid>http://www.phpdeveloper.org/news/17054</guid>
      <link>http://www.phpdeveloper.org/news/17054</link>
      <description><![CDATA[<p>
In a new post to DZone.com <i>Mitchell Pronschinske</i> looks at <a href="http://css.dzone.com/articles/closure-object-binding-php-54">closure object binding</a> in PHP 5.4 applications (yes, we know PHP 5.4 isn't released yet). He explains what this is an shows some sample use cases for you to consider in your development.
</p>
<blockquote>
For the people who read PHP's NEWS file, it's no surprise - but for all who don't here's is probably one of the biggest features of PHP 5.4: Closure Object Support is back. For me it's something I missed the most, when Closures were introduced in PHP 5.3. So I'm very happy, that's finally here (or back). I'm going to tell you about the rocky road which closure object binding support had and show you some simple use cases for it.
</blockquote>
<p>
The functionality, based on <a href="https://wiki.php.net/rfc/closures/object-extension">this RFC</a>, lets you more correctly bind closures to objects instead of having to pass the objects into the closure at create time. He includes an example from a <a href="http://silex.sensiolabs.org/">Silex</a> framework application and <a href="https://gist.github.com/1121233">an example</a> that refactors a helper method as a part of rendering a simple template.
</p>]]></description>
      <pubDate>Fri, 28 Oct 2011 08:43:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ZetCode.com: SQLite PHP tutorial]]></title>
      <guid>http://www.phpdeveloper.org/news/17001</guid>
      <link>http://www.phpdeveloper.org/news/17001</link>
      <description><![CDATA[<p>
If you're in the process of prototyping a site or just need a lightweight storage tool for your application, you might look into <a href="http://www.sqlite.org/">SQLite</a>. Fortunately, PHP has direct support for it and <a href="http://zetcode.com/databases/sqlitephptutorial/">this great tutorial</a> from ZetCode.com will introduce you to some of the basic concepts you'll need to get working (it's a bit older, but still very useful).
</p>
<blockquote>
This is a PHP programming tutorial for the SQLite database. It covers the basics of SQLite programming with PHP language. There are two ways to code PHP scripts with SQLite library. We can use procedural functions or OOP objects and methods. In this tutorial, we use the classical procedural style. You might also want to check the <a href="http://zetcode.com/language/phptutorial/">PHP tutorial</a> or <a href="http://zetcode.com/databases/sqlitetutorial/">SQLite tutorial</a> on ZetCode.
</blockquote>
<p>
They go through the basic installation (on a linux platform, but easily adapted to others) including changes to your php.ini and the creation and use of a first sample database. You'll find the interface very similar to some of its other RDBMS cousins with a few exceptions. They show you the CRUD basics - creating records, reading the contents of a table, updating data already there and deleting records. There's also a simple form tutorial that takes a name and gender and does the inserts. 
</p>]]></description>
      <pubDate>Mon, 17 Oct 2011 12:12:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: The Ins and Outs of PHP Exceptions]]></title>
      <guid>http://www.phpdeveloper.org/news/16993</guid>
      <link>http://www.phpdeveloper.org/news/16993</link>
      <description><![CDATA[<p>
On NetTuts.com today there's <a href="http://net.tutsplus.com/tutorials/php/the-ins-and-outs-of-php-exceptions/">a new tutorial</a> showing you the "ins and outs" of using <a href="http://php.net/exceptions">exceptions</a> in PHP - throwing them, handling the result and integrating them into your error handling process.
</p>
<blockquote>
Still returning false whenever a function in your program fails? In this article, we'll learn about PHP exceptions, and how you can use them to soup up your application's error handling.
</blockquote>
<p>
The include some of the methods you can call on your exceptions (including getting the message, code, file, line and the results of a <a href="http://php.net/debug_backtrace">debug_backtrace</a> right before it was thrown). Included is code to throw exceptions, catch them with a try/catch and using error codes as return values and extending them to fit your own needs.
</p>]]></description>
      <pubDate>Fri, 14 Oct 2011 08:44:32 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Carson McDonald's Blog: Google OAuth for Installed Apps PHP Example]]></title>
      <guid>http://www.phpdeveloper.org/news/16978</guid>
      <link>http://www.phpdeveloper.org/news/16978</link>
      <description><![CDATA[<p>
<i>Carson McDonald</i> has posted an example of how to <a href="http://www.ioncannon.net/programming/1443/google-oauth-for-installed-apps-php-example/">use the Google OAuth for Installed Apps</a> tool to authenticate users.
</p>
<blockquote>
I have been working on a long needed update to the <a href="http://www.ioncannon.net/projects/google-analytics-dashboard-wordpress-widget/">Google analytics dashboard plugin for WordPress</a> and one of the items I had on my TODO list was using Google's OAuth login instead of the old ClientLogin. Setting OAuth up for a WordPress plugin is complicated because it isn't a hosted application and as such I can't register it to get OAuth keys. That is where a special way of doing OAuth comes in called <a href="http://code.google.com/apis/accounts/docs/OAuthForInstalledApps.html">OAuth for installed apps</a>.
</blockquote>
<p>
He uses <a href="http://oauth.googlecode.com/svn/code/php/">this OAuth library</a> to handle the "dirty work" of the connections. With that included in the application, he shows how to - in two phases - make an authentication system that direct the user to a Google link for completing the authentication process. He points to the <a href="http://code.google.com/apis/gdata/articles/oauth.html">Google OAuth docs</a> and <a href="http://googlecodesamples.com/oauth_playground/">playground</a> as good resources to help you during the process.
</p>]]></description>
      <pubDate>Tue, 11 Oct 2011 12:13:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Array Handling Functions]]></title>
      <guid>http://www.phpdeveloper.org/news/16974</guid>
      <link>http://www.phpdeveloper.org/news/16974</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial introducing you to <a href="http://phpmaster.com/array-handling-functions/">the array handling features</a> in PHP - sorting, slicing and more.
</p>
<blockquote>
In my <a href="http://phpmaster.com/introduction-to-php-arrays/">previous article on PHP arrays</a> I suggested a number of things that are tables and therefore can also be expressed as arrays. In this article I'll use a pack of playing cards to explore some of the built-in array functions most often needed by PHP programmers.
To highlight some of the array-handling functions PHP offers, I'll be using some components of <a href="http://en.wikipedia.org/wiki/Buraco">Buraco</a> - a game very popular in my part of the world and quite similar to Rummy.
</blockquote>
<p>
In the example he represents a deck of cards with an array of values like "A", "03" and "13". This array is then looped to make the full set of 52 cards and shuffled to deal a "hand". Array functions put to use include <a href="http://php.net/array_rand">array_rand</a>, <a href="http:/php.net/in_array">in_array</a> and <a href="http://php.net/sort">sort</a>.
</p>]]></description>
      <pubDate>Tue, 11 Oct 2011 08:37:55 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Documentation Makes the World Go Round]]></title>
      <guid>http://www.phpdeveloper.org/news/16945</guid>
      <link>http://www.phpdeveloper.org/news/16945</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new article emphasizing something that lots of developers forget to make a part of their process when writing code - <a href="http://phpmaster.com/documentation-makes-the-world-go-round/">creating useful documentation</a> to help make your code that much clearer.
</p>
<blockquote>
If you're writing code that will be shared with others, put yourself in their shoes. Don't let your project lose potential users, community members, and possible contributors all because of insufficient documentation.
</blockquote>
<p>
He (<i>Matthew Turland</i>) suggests a few things to keep in mind as you're writing up your documentation - the content is "king" (an emphasis on good descriptions/examples/use cases), open it up to external contributions using things like wikis (or even stored in the source code repository) and a focus on technical writing skills. Even the best tools out there can suffer if there's poor or no documentation.
</p>]]></description>
      <pubDate>Tue, 04 Oct 2011 09:03:16 -0500</pubDate>
    </item>
  </channel>
</rss>

