<?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 11:35:54 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Brandon Savage: Effective Refactoring Strategies]]></title>
      <guid>http://www.phpdeveloper.org/news/18943</guid>
      <link>http://www.phpdeveloper.org/news/18943</link>
      <description><![CDATA[<p>
In a recent post to his site, <i>Brandon Savage</i> has <a href="http://www.brandonsavage.net/effective-refactoring-strategies/">a few helpful hints</a> to keep in mind when you're refactoring your applications to make them easier to maintain (and possibly perform better) in the future.
</p>
<blockquote>
The downtime [of this week] provides a perfect opportunity for the aspiring software developer to do the one thing they are always told there's no time to do: make the code better for better's sake. With few deadlines and plenty of free time, most developers can get a few hours of refactoring in to their code towards the end of the year. They can rearchitect sections that were implemented with haste in September; they can write tests for sections that were untested in April. Put another way, the "lost week" can be redeemed.
</blockquote>
<p>He has a few recommendations, each including their own brief summary:</p>
<ul>
<li>Test Everything First
<li>One Method, One Job (Also One Class, One Job)
<li>Don't Be Afraid Of More Objects And Classes
<li>Remove Dead, Unused, Unnecessary or Old Code
<li>Document Your Code
</ul>
<p>
Check out the <a href="http://www.brandonsavage.net/effective-refactoring-strategies/">full post</a> for the summaries and links to other useful resources.
</p>]]></description>
      <pubDate>Mon, 24 Dec 2012 11:24:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: The Single Responsibility Principle]]></title>
      <guid>http://www.phpdeveloper.org/news/18789</guid>
      <link>http://www.phpdeveloper.org/news/18789</link>
      <description><![CDATA[<p>
On PHPMaster.com today <i>Alejandro Gervasio</i> has a new tutorial posted about the <a href="http://phpmaster.com/the-single-responsibility-principle/">Single Responsibility Principle</a> - a guideline that states that each class should only have one "area of concern" and not try to do to much.
</p>
<blockquote>
One of the most notorious consequences of this rational associative process is that, at some point, we effectively end up creating classes that do too much. The so-called "God class" is quite possibly the most extreme and coarse example of a structure that packages literally piles of unrelated operations behind the fence of the same API, but there are other subtle, more furtive situations where assigning of multiple roles to the same class are harder to track down. [...] What the principle attempts to promote is that classes must always be designed to expose only one area of concern and the set of operations they define and implement must be aimed at fulfilling that concern in particular and nothing else.
</blockquote>
<p>
He starts off with a typical violation of the principle, showing a class that not only handles user data but also includes the functions to work with the database directly as well (insert/update/delete). He refactors this into a few much more manageable classes - a mapping class to handle the database interaction and a "User" class representative of a true user object. 
</p>]]></description>
      <pubDate>Thu, 22 Nov 2012 11:58:06 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Freek Lijten's Blog: SOLID - The S is for Single responsibility]]></title>
      <guid>http://www.phpdeveloper.org/news/17723</guid>
      <link>http://www.phpdeveloper.org/news/17723</link>
      <description><![CDATA[<p>
<i>Freek Lijten</i> has <a href="http://www.freeklijten.nl/home/2012/03/23/SOLID-The-S-is-for-Single-responsibility">written up a new post</a> to his blog about a set of development principles that have been getting more press in the PHP community lately - <a href="http://en.wikipedia.org/wiki/SOLID">SOLID</a>. In his post he starts with a look at the "S" in the set - "Single Responsibility".
</p>
<blockquote>
The single responsibility principle isn't all that hard to explain. It states that an object should do one thing, and one thing only. [...]  A responsibility is a reason to change, and a class should only have one of those. Now all of this may sound abstract and since the objective of this series is to avoid just that we'll just dive into the why now.
</blockquote>
<p>
He includes some sample code to illustrate, going with an active record implementation, some of the problems that come with a typical setup including issues with unit testing, bad practice of using the data store directly, etc. He shows a refactored code example that splits out the functionality previously all in the one class ("Bike") into three different ones - one is the normal Bike object, another compares the Bikes and the third works with the data store to handle the <a href="http://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD</a> for the objects.
</p>]]></description>
      <pubDate>Fri, 23 Mar 2012 11:23:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Working Software Blog: Escaping single and double quotes for use with XPath queries in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16746</guid>
      <link>http://www.phpdeveloper.org/news/16746</link>
      <description><![CDATA[<p>
On the Working Software blog there's a new post showing a solution to a issue with <a href="http://www.workingsoftware.com.au/page/Escaping_single_and_double_quotes_in_XPath_queries_in_PHP">escaping quotes in XPath queries</a> that's not just an issue in PHP.
</p>
<blockquote>
I've been working with the Basecamp API to plugin our IRC bot that we use for time tracking and I'm astounded to learn that escaping single and/or double quotes for XPath queries in PHP does not have a well documented, best practices solution. In fact, it seems as though this is not peculiar to PHP. I took a look around and found this excellent article by "Kushal": <a href="http://kushalm.com/the-perils-of-xpath-expressions-specifically-escaping-quotes">http://kushalm.com/the-perils-of-xpath-expressions-specifically-escaping-quotes</a>.
</blockquote>
<p>
He's put together <a href="https://gist.github.com/1155973">his own (PHP) solution</a> to the problem - running the entire XPath query through a filtering method that splits it up, replaces the quote characters and combines it back down to a single string.
</p>]]></description>
      <pubDate>Fri, 19 Aug 2011 13:50:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lullabot.com: Single Sign-on across Sub-Domains in Drupal with No Extra Modules]]></title>
      <guid>http://www.phpdeveloper.org/news/14122</guid>
      <link>http://www.phpdeveloper.org/news/14122</link>
      <description><![CDATA[<p>
On the Lullabot.com blog there's a recent post from <i>Nate Haug</i> showing how you can <a href="http://www.lullabot.com/articles/drupal-single-sign-across-sub-domains">set up a single sign on with Drupal</a> even if your user crosses multiple sub-domains on your site. The technique is particularly handy in that it doesn't require any extra modules to be installed to make it work.
</p>
<blockquote>
With the multitude of single sign-on modules out there for Drupal, it's easy to miss the fact that Drupal has a built-in single sign on mechanism already. No modules, no configuration, just 20 easy lines of PHP in your site's settings.php file. This solution works for a lot of clients, but the set of requirements is pretty specific as to when you can use this approach.
</blockquote>
<p>
To make it work all sites must be on the same domain (just sub-domains of it), be using MySQL as your backend database and, if you're using clustered hardware, they need to be on the same cluster to be able to make the cross-database queries. Since Drupal can prefix tables so the settings for each site are split out, you can create a "shared table" by making a few changes in your master and slave configuration.
</p>]]></description>
      <pubDate>Wed, 03 Mar 2010 11:06:57 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Arnold Daniels' Blog: Simple Single Sign-On for PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12371</guid>
      <link>http://www.phpdeveloper.org/news/12371</link>
      <description><![CDATA[<p>
<i>Arnold Daniels</i> has a new post to his blog today dealing with something (usually companies) are looking towards to help deal with the infamous "too many passwords for too many places" issue - a <a href="http://blog.adaniels.nl/articles/simple-single-sign-on-for-php/">simple single sign-on tool</a> that can be dropped in an used anywhere.
</p>
<blockquote>
Associated websites often share user information, so a visitor only has to register once and can use that username and password for all sites. A good example for this is Google. [...] There are many single sign-on applications and protocols. Most of these are fairly complex. [...] I've written a simple single sign-on solution (400 lines of code), which works by linking sessions. This solutions works for normal websites as well as AJAX sites.
</blockquote>
<p>
He compares the flow on a non-single sign-on <a href="http://blog.adaniels.nl/wp-content/uploads/sso-diagram_no-sso.png">site</a> (lots of fetching between the client/server) and the <a href="http://blog.adaniels.nl/wp-content/uploads/sso-diagram_alex.png">first</a>/<a href="http://blog.adaniels.nl/wp-content/uploads/sso-diagram_binck.png">following</a> visits with his tool in place. You can <a href="http://blog.adaniels.nl/downloads/SSO.zip">download the source here</a> (as well as the <a href="http://blog.adaniels.nl/downloads/SSO.ajax-broker.zip">Ajax broker</a>).
</p>]]></description>
      <pubDate>Mon, 20 Apr 2009 09:36:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Raphael Stolt's Blog: Zend Framework coding standards on one page]]></title>
      <guid>http://www.phpdeveloper.org/news/9610</guid>
      <link>http://www.phpdeveloper.org/news/9610</link>
      <description><![CDATA[<p>
<i>Raphael Stolt</i>, in working on his component for the Zend Framework (based on the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> PEAR package), pulled together all of the information Zend provides about their coding standards into one place.
</p>
<blockquote>
Before jumping into the development of a Zend Framework coding standard for the <a href="http://pear.php.net/package/PHP_CodeSniffer">PHP_CodeSniffer</a> Pear package, I spent some time revisiting and compiling the available Zend Framework <a href="http://framework.zend.com/manual/en/coding-standard.html">coding standards</a> into a handy one-paged Pdf document.
</blockquote>
<p>
You can <a href="http://raphael.stolt.googlepages.com/ZendFramework_coding_standards_on_on.pdf">download the file here</a> or, if you want something a bit more "spread out", check out <a href="http://framework.zend.com/manual/en/coding-standard.html">the coding standards</a> on the Zend Framework website.
</p>]]></description>
      <pubDate>Tue, 12 Feb 2008 07:59:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect: Stuff your stockings: single issues 30% off]]></title>
      <guid>http://www.phpdeveloper.org/news/9300</guid>
      <link>http://www.phpdeveloper.org/news/9300</link>
      <description><![CDATA[<p>
The mystery has been relealed - the <a href="http://www.phparch.com">php|architect</a> folks have <a href="http://www.phparch.com/c/news/view/20071221-special_issue_price.src">posted about their secret</a> today - a discount on single issues of 30%.
</p>
<blockquote>
Seasons greetings everyone! The first of two surprises from us today is a great opportunity to combine our recent drop of all DRM protection on our PDFs with an awesome 30% discount on our single-issue prices to stock up on all your favourite past issues of php|architect.
</blockquote>
<p>
This means that single issues are priced at (about) $3.49 CAD for a few days - all you need to do is pick your favorites from <a href="http://www.phparch.com/c/magazine/archive">their archive</a>, even their <a href="http://www.phparch.com/c/magazine/issue/63">most recent issue</a>.
</p>]]></description>
      <pubDate>Fri, 21 Dec 2007 13:47:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Alex Netkachov's Blog: Jamp! is Updated]]></title>
      <guid>http://www.phpdeveloper.org/news/9108</guid>
      <link>http://www.phpdeveloper.org/news/9108</link>
      <description><![CDATA[<p>
<i>Alex Netkachov</i> has <a href="http://www.alexatnet.com/node/106">posted about the update</a> he's just released to the <a href="http://www.alexatnet.com/node/47">Jamp!</a> package.
</p>
<blockquote>
I've updated the Jamp! All packages are updated to the latests stable version available, the "Server" and "Service" commands are added for Tomcat 6.0, Jamp.hta UI is updated
</blockquote>
<p>
<a href="http://www.alexatnet.com/node/47">Jamp!</a> is a single-click installer for PHP/Java/Apache/MySQL to make installing them (and getting them working together) simple.
</p>]]></description>
      <pubDate>Fri, 23 Nov 2007 14:08:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Working with Strings and the Composite Pattern in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/7431</guid>
      <link>http://www.phpdeveloper.org/news/7431</link>
      <description><![CDATA[<p>
DevShed has posted <a href="http://www.devshed.com/c/a/PHP/Working-with-Strings-and-the-Composite-Pattern-in-PHP-5/">the second and last part</a> of a series of two articles based around the Composite design pattern - using it to work with strings in PHP5.
</p>
<blockquote>
Are you a PHP developer who wants to improve your skills in pattern-based programming in PHP? If the answer to this question is a emphatic yes, then you should begin reading this article now! Welcome to the final part of the series "Implementing the composite pattern with PHP 5." Comprised of two instructive tutorials, this series walks you through the basic concepts of this important design pattern, and shows you how to apply it with some educational examples.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Working-with-Strings-and-the-Composite-Pattern-in-PHP-5/1/">start by defining</a> a simple StringProcessor class as an abstract interface to build from. From there, they create two other classes - the SingleStringProcessor and the MultipleStringProcessor. Each of these takes in either a single file or multiple filenames and spits back out the value of the string and the length of the string.
</p>]]></description>
      <pubDate>Wed, 14 Mar 2007 11:14:00 -0500</pubDate>
    </item>
  </channel>
</rss>
