<?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>Sat, 25 May 2013 18:40:56 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gonzalo Ayuso: Multiple inheritance with PHP and Traits]]></title>
      <guid>http://www.phpdeveloper.org/news/18919</guid>
      <link>http://www.phpdeveloper.org/news/18919</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post today showing how you can use <a href="http://php.net/traits">traits</a> in PHP to simulate <a href="http://gonzalo123.com/2012/12/17/multiple-inheritance-with-php-and-traits/">a kind of multiple inheritance</a>.
</p>
<blockquote>
Multiple inheritance isn't allowed in PHP. [It's not] possible with PHP (in Java is not possible either), but today we can do something similar (is not the exactly the same) with Traits. Let me explain that: Instead of classes we can create Traits.
</blockquote>
<p>
He includes a code example showing the creation of two traits, "Base1" and "Base2", that are implemented (via "use") and the calls to methods on each. He also points out the error condition and message that can come up when there's a conflict in the method names between two or more traits. This is relatively easy to solve with the mapping ability of the "use" statement (code example included for that too).
</p>]]></description>
      <pubDate>Wed, 19 Dec 2012 13:17:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Josh Adell: Interfaces and Traits: A Powerful Combo]]></title>
      <guid>http://www.phpdeveloper.org/news/18530</guid>
      <link>http://www.phpdeveloper.org/news/18530</link>
      <description><![CDATA[<p>
<i>Josh Adell</i> has a new post today looking at the "powerful combination" of using traits and interfaces in PHP applications. He shows how, despite traits not implementing the interface directly, they can <a href="http://blog.everymansoftware.com/2012/09/interfaces-and-traits-powerful-combo.html">be used to make other classes adhere to them</a> simply by "using" them.
</p>
<blockquote>
If you're not using <a href="http://php.net/manual/en/language.oop5.interfaces.php">interfaces</a> in PHP, you are missing out on a powerful object-oriented programming feature. An interface defines how to interact with a class. By defining an interface and then implementing it, you can guarantee a "contract" for consumers of a class. Interfaces can be used across unrelated classes. And they become even more useful when combined with the new <a href="http://php.net/manual/en/language.oop5.traits.php">traits</a> feature in PHP 5.4.
</blockquote>
<p>
He illustrates with a package shipping example and uses an "Addressable" Interface to define the structure for both a Company and Users class. He includes code showing how to implement it in a more traditional "implements" way in a class, but also shows an interesting way to achieve the same thing with traits. Having a trait that follows the interface makes it easy to have a class adhere to the interface just by including the trait (or "using" it).
</p>]]></description>
      <pubDate>Fri, 28 Sep 2012 08:51:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: 10 reasons to use PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18027</guid>
      <link>http://www.phpdeveloper.org/news/18027</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i>, in his move towards doing some mobile development, has <a href="http://www.eschrade.com/page/10-reasons-to-use-php-for-your-mobile-project/">a new post</a> to his blog about why he's still going to stick with PHP for the backend of this new development work.
</p>
<blockquote>
I do like working with client/server-like architectures and so I intend to be building apps that have a fair amount of server-side processing to back it up.  More details on that to come in the next few months. [...] I have decided that, for the time being, to use PhoneGap for my frontend development. [...] So the question was what to use for the backend development and, to nobody's surprise I presume, PHP is my chosen way to go.
</blockquote>
<p>Some of his reasons for the choice include:</p>
<ul>
<li>PHP is stupid easy to scale
<li>It is tied to the web
<li>(Available) Frameworks
<li>Tons of blogs
<li>It integrates with everything
</ul>
<p>
Check out <a href="http://www.eschrade.com/page/10-reasons-to-use-php-for-your-mobile-project/">the post</a> for more of his reasons.
</p>]]></description>
      <pubDate>Thu, 31 May 2012 08:47:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: A primer on PHP namespaces]]></title>
      <guid>http://www.phpdeveloper.org/news/17549</guid>
      <link>http://www.phpdeveloper.org/news/17549</link>
      <description><![CDATA[<p>
For those that either haven't worked much with PHP 5.3 in their applications (or just haven't gotten around to using the feature) <i>Rob Allen</i> has <a href="http://akrabat.com/php/a-primer-on-php-namespaces/">put together an introduction to namespaces</a> to guide you through some first steps and share some example usage.
</p>
<blockquote>
I know that there are a lot of posts now about namespaces in PHP 5.3. This is mine which is how I learnt how they work. [...] That is, namespaces allow us to: combine libraries with the same classnames, avoid very long classnames and organise our code easily. Note that namespaces do not just affect classes. They also affect functions and constants.
</blockquote>
<p>
He starts with the basic namespace definition (using the "namespace" keyword), shows how to import another namespace with "use" and the use of the __NAMESPACE__ constant to determine what namespace you're operating in. More information on namespaces can be found <a href="http://php.net/manual/en/language.namespaces.rationale.php">in the PHP manual</a>.
</p>]]></description>
      <pubDate>Thu, 16 Feb 2012 08:25:43 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Query7.com: Why You Should Be Using A PHP Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/16172</guid>
      <link>http://www.phpdeveloper.org/news/16172</link>
      <description><![CDATA[<p>
On the Query7.com blog, <i>Logan</i> has posted his opinion on how you should be doing your development on sites that are more than just one or two pages - you <a href="http://query7.com/why-you-should-be-using-a-php-framework">should be using a framework</a>.
</p>
<blockquote>
Frameworks should be used when constructing web applications. Any application that involves a database, forms, sessions, cookies or a remote service (such as Twitter or Facebook) will benefit from being powered by a framework. There is no need to use a framework for a website that has only one or two pages, nor for command line utility scripts.
</blockquote>
<p>
He lists some of the common features frameworks provide including database abstraction, caching, form management, authentication and internationalization. He also includes some of the more general benefits you get from using frameworks like portability, shorter development time, application security, plugins/module support and the enforcement of good coding standards (depends on the framework, obviously).
</p>]]></description>
      <pubDate>Mon, 11 Apr 2011 09:58:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Propel Blog: The End of Autoloading]]></title>
      <guid>http://www.phpdeveloper.org/news/16103</guid>
      <link>http://www.phpdeveloper.org/news/16103</link>
      <description><![CDATA[<p>
On the Propel blog there's a recent post talking about how the <a href="http://propel.posterous.com/the-end-of-autoloading">age of autoloading might be ending</a> and how namespacing could be the next logical step (or could it).
</p>
<blockquote>
Autoloading in PHP is a great time saver. It lets you write concise scripts without the knowledge of the exact directory structure of the libraries you use. But with the arrival of namespaces in PHP 5.3, and the influence of Java over new generation PHP frameworks, autoloading is changing. In the near future, explicit autoloading will be ubiquitous, but with none of the advantages of the old style autoloading.
</blockquote>
<p>
He talks about "the old days" when things were included manually through file paths, how that graduated to the SPL autoloading and, most recently, up to namespace autoloading. He shares code samples of how the namespace loading works and how you can abuse it to override current classes/functionality with your own. He points out one interesting correlation though - that the "use" keyword seems a lot like the "require_once" of way back when. He shows how the added verbosity of namespace usage can be a hinderance on frameworks, citing microframeworks specifically and showing one implementation that's non-namespaced next to another that is.
</p>]]></description>
      <pubDate>Fri, 25 Mar 2011 11:13:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Taking advantage of PHP namespaces with older code]]></title>
      <guid>http://www.phpdeveloper.org/news/15838</guid>
      <link>http://www.phpdeveloper.org/news/15838</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> has <a href="http://www.rooftopsolutions.nl/blog/taking-advantage-of-php-namespaces-with-older-code">a quick post</a> about a suggestion mentioned at <a href="http://conference.phpbenelux.eu/2011/">PHPBenelux</a> related to using namespaces with older code.
</p>
<blockquote>
If you're running PHP 5.3 and you have to use pesky old code that uses long class prefixes (yea, so, pretty much all PHP code out there), you can still make use of namespace features to shorten them.
</blockquote>
<p>
He includes a quick example that shows the shift from using the traditional Zend_Controller_Action_Helper_AutoComplete_Abstract to an aliasing with the use/as to just reference it as AutoComplete.
</p>]]></description>
      <pubDate>Tue, 01 Feb 2011 10:10:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroder's Blog: You want to do WHAT with PHP?]]></title>
      <guid>http://www.phpdeveloper.org/news/14995</guid>
      <link>http://www.phpdeveloper.org/news/14995</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Kevin Schroeder</i> talks about <a href="http://www.eschrade.com/page/want-what-with-4c6d63c8">a book he's written</a> about some of the stranger things you can do with PHP - <a href="http://www.mc-store.com/5112.html">You want to do WHAT with PHP?</a>.
</p>
<blockquote>
You will not find another book on the market like it.  Mostly because other PHP authors are not as crazy as I am. [...] In short, if you want a book that goes beyond the practical for the purpose of expanding your mind, this is the book for you.  It is not meant to be a "cookbook", pre se.  It is meant to, as Einstein put it, stretch your mind so that it does not return to its original shape. 
</blockquote>
<p>
You can see the <a href="http://www.mcpressonline.com/product_images/BookPDFs/5112_TOC.pdf">table of contents</a> [pdf] and a <a href="http://www.mcpressonline.com/product_images/BookPDFs/5112_EXP.pdf">sample chapter</a> [pdf] about working with daemons. Other topics covered include networking/sockets, streams, character encoding, debugging, profiling and good development practices. You can pick up your copy on the <a href="http://www.mc-store.com/5112.html">MC Press</a> site and have it shipped in early September 2010.
</p>]]></description>
      <pubDate>Fri, 20 Aug 2010 08:50:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ivo Jansch's Blog: Good use of public, private and protected in OO class design]]></title>
      <guid>http://www.phpdeveloper.org/news/14811</guid>
      <link>http://www.phpdeveloper.org/news/14811</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Ivo Jansch</i> responds to some of the recent comments about scoping in PHP applications with some <a href="http://www.jansch.nl/2010/07/19/good-use-of-public-private-and-protected-in-oo-class-design/">thoughts of his own</a> (someone spurred on by the <a href="http://symfony-project.org">Symfony</a> project saying that "private is evil").
</p>
<blockquote>
I don't care much about Symfony as I'm not a user, but it turned to a discussion on OO theory when Stefan <A href="http://www.leftontheweb.com/message/My_privates_are_not_public_they_are_protected">defended the position</a> by claiming that you 'should have the right to extend a class's methods if it doesn't support the use case you have'.
</blockquote>
<p>
He also mentions the agreeing opinions of <a href="http://twitter.com/mtabini/status/18867470296">Marco Tabini</a> and <a href="http://twitter.com/tswicegood/status/18864493405">Travis Swicegood</a>. <i>Ivo</i> gives an example of a piece of code that uses all three states - public, protected and private - as a use case for his later statements. In his opinion, removing the private/protected scoping from the picture only helps those looking to make it easier to derive information from the class rather than fine-tuning what can be called.
</p>
<p>
Be sure to <a href="http://www.jansch.nl/2010/07/19/good-use-of-public-private-and-protected-in-oo-class-design/#comments">read the comments</a> on this one - there's lots of great thoughts from community members in there.
</p>]]></description>
      <pubDate>Mon, 19 Jul 2010 10:57:14 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[php|architect Blog: To use a framework, or not to: that is the question ]]></title>
      <guid>http://www.phpdeveloper.org/news/14296</guid>
      <link>http://www.phpdeveloper.org/news/14296</link>
      <description><![CDATA[<p>
On the php|architect blog there's a recent post from <i>Jayesh Wadhwani</i> asking a question developers all over the world wonder every day - <a href="http://www.phparch.com/2010/04/02/to-use-a-framework-or-not-to-that-is-the-question/">to use a framework or not to</a> (and what's the benefit)?
</p>
<blockquote>
A framework is usually thought of or defined as an underlying structure.  You could imagine a wooden structure, sort of a skeleton when a house is being built. This provides a guide, structure and flow to build the house. A programming framework pretty much does the same thing.  A programming framework provides for a structured and disciplined programming which results in a more consistent output from a programming team.
</blockquote>
<p>
He talks more about some of the things that come with framework use like the utility and "housekeeping" code as well as code you know has been tested and used by other projects successfully (especially with something like the <a href="http://framework.zend.com">Zend Framework</a>. Remember, though, there's bad that comes with them - a possible steep learning curve and overhead that could be caused by using the tools it gives you badly.
</p>]]></description>
      <pubDate>Mon, 05 Apr 2010 10:05:20 -0500</pubDate>
    </item>
  </channel>
</rss>
