<?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 15:38:46 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Ibuildings techPortal: DPC Radio: Advanced OO Patterns]]></title>
      <guid>http://www.phpdeveloper.org/news/17409</guid>
      <link>http://www.phpdeveloper.org/news/17409</link>
      <description><![CDATA[<p>
On the Ibuildings techPortal today they've posted the latest episode in their DPC Radio series as recorded at the last <a href="http://phpconference.nl">Dutch PHP Conference</a>. In <a href="http://techportal.ibuildings.com/2012/01/17/dpc-radio-advanced-oo-patterns/">this new episode</a> they share a session from <i>Tobias Schlitt</i> called "Advanced OO Patterns".
</p>
<blockquote>
You already know Singleton, Signal/Observer, Factory and friends. But, which object oriented patterns are en vogue in the PHP world and how can you seize their power? This talk gives you an overview on Dependency Injection, Data Mapper and more OO patterns the PHP world talks about right know, using practical code examples.
</blockquote>
<p>
You can listen to this latest episode either via the <a href="http://techportal.ibuildings.com/2012/01/17/dpc-radio-advanced-oo-patterns/">in-page player</a> or by <a href="http://dpcradio.s3.amazonaws.com/2011_001.mp3">downloading the mp3</a> directly. You can follow along with the talk in <a href="http://qafoo.com/presentations.html">his slides</a> over on the qafoo.com site.
</p>]]></description>
      <pubDate>Wed, 18 Jan 2012 08:42:54 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: The Closure Puzzle]]></title>
      <guid>http://www.phpdeveloper.org/news/17397</guid>
      <link>http://www.phpdeveloper.org/news/17397</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has <a href="http://daveyshafik.com/archives/32789-the-closure-puzzle.html">posted about an interesting find with closures</a> in PHP revolving around an update to add "$this" access inside the closure.
</p>
<blockquote>
However, it didn't stop there; there was also the addition of Closure::bind() and Closure->bindTo(). These methods are identical except one is a static method into which the closure is passed, the second an instance method on the closure itself. These methods both take two arguments (on top of the closure for the static version): $newthis and $newscope. What this means is that unlike the regular object model the concept of $this and lexical scope (what is in scope for the function with regards to private/protected methods inside objects) are completely separated.
</blockquote>
<p>
He also mentions that you can change the "$this" to a different object (complex) or swapping out the object the closure is bound to while keeping "$this" the same (simpler). He mentions that it could be useful for unit testing but can have its drawbacks. He's <a href="https://gist.github.com/1607647">included code</a> to illustrate 
 the breakage it can cause in the PHP OOP model (with an explanation).
</p>]]></description>
      <pubDate>Mon, 16 Jan 2012 09:52:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Runtime Classes. A experiment with PHP and Object Oriented Programming]]></title>
      <guid>http://www.phpdeveloper.org/news/16684</guid>
      <link>http://www.phpdeveloper.org/news/16684</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has put together an experiment related to the current OOP structure of PHP - a test <a href="http://gonzalo123.wordpress.com/2011/08/08/runtime-classes-a-experiment-with-php-and-object-oriented-programming/">working with runtime classes</a>, a structure generated entirely when the script is executed and not predefined in the file.
</p>
<blockquote>
Last week I was thinking about creation of a new type of classes. PHP classes but created dynamically at run time. When this idea was running through my head I read the following <a href="http://dhotson.tumblr.com/post/1167021666/php-object-oriented-programming-reinvented">article</a> and I wanted to write something similar. Warning: Probably that it is something totally useless, but I wanted to create a working prototype (and it was fun to do it).
</blockquote>
<p>
His class is pretty basic - a "Human" object that echoes a "hello world" sort of message via a "hello()" method. He creates the classes inside of different test methods to ensure that his assertions are true. The tests check basic output of the "hello()" method, calling undefined methods, testing inheritance and a test creating and evaluating a dynamic function.
</p>
<p>
For something more complex, he creates a dynamic class that solves the <a href="http://codingdojo.org/cgi-bin/wiki.pl?KataFizzBuzz">FizzBuzz</a> kat, a popular programming puzzle. You can find the full code for this and his other examples <a href="https://github.com/gonzalo123/HClass">on github</a>.
</p>]]></description>
      <pubDate>Mon, 08 Aug 2011 09:17:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Elated.com: Object-Oriented PHP: Autoloading, Serializing, and Querying Objects]]></title>
      <guid>http://www.phpdeveloper.org/news/16542</guid>
      <link>http://www.phpdeveloper.org/news/16542</link>
      <description><![CDATA[<p>
On Elated.com today there's the <a href="http://www.elated.com/articles/object-oriented-php-autoloading-serializing-and-querying-objects/">fourth part of their series</a> looking at object oriented programming in PHP. This time the focus is specifically on autoloading classes, making objects into strings (serialized) and introspection.
</p>
<blockquote>
If you've read all the articles up to this point then you're already familiar with the most important concepts of object-oriented programming in PHP: classes, objects, properties, methods, and inheritance. In this final (for now, at least!) tutorial in the series, I'm going to tie up some loose ends and look at some other useful OOP-related features of PHP.
</blockquote>
<p>
He looks at each of the three topics above and includes code for things like a simple autoloader, object serialization, using sleep/wakeup and an example of using functions like <a href="http://php.net/get_class">get_class</a>, <a href="http://php.net/get_class_methods">get_class_methods</a> and <a href="http://php.net/get_object_vars">get_object_vars</a> to do introspection on your classes and objects.
</p>]]></description>
      <pubDate>Fri, 01 Jul 2011 08:29:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: SOLID OO Principles]]></title>
      <guid>http://www.phpdeveloper.org/news/16431</guid>
      <link>http://www.phpdeveloper.org/news/16431</link>
      <description><![CDATA[<p>
On the Zend Developer Zone there's a recent post from <i>Keith Casey</i> about some of the <a href="http://devzone.zend.com/article/15243-SOLID-OO-Principles">basics of good OOP design</a>, specifically in following the <a href="http://en.wikipedia.org/wiki/Solid_(object-oriented_design)">SOLID</a> principles - a set of five guidelines that make code easier to manage and maintain over time.
</p>
<blockquote>
As much as we're like to believe that "loose coupling, high cohesion" is enough, when you actually dive into the concept, you find that it's more descriptive than prescriptive. If you want to know how to actually apply these to your day to day development, you have to get into the <a href="http://en.wikipedia.org/wiki/Solid_(object-oriented_design)">SOLID</a> principles which describes the five tangible aspects that "good" OO design should contain.
</blockquote>
<p>
He goes through each of the five principles in the list, describing what they are and, for some, including a bit of sample code to make the point clearer:
</p>
<ul>
<li>Single Responsibility Principle (SRP)
<li>Open/Closed Principle (OCP)
<li>Liskov Substitution Principle (LSP)
<li>Interface Segregation Principle (ISP)
<li>Dependency Inversion Principle (DIP)
</ul>]]></description>
      <pubDate>Mon, 06 Jun 2011 12:06:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Elated.com: Object-Oriented PHP: Working with Inheritance]]></title>
      <guid>http://www.phpdeveloper.org/news/16391</guid>
      <link>http://www.phpdeveloper.org/news/16391</link>
      <description><![CDATA[<p>
On Elated.com there's a new <a href="http://www.elated.com/articles/object-oriented-php-working-with-inheritance/">introduction to working with inheritance in PHP</a> for object-oriented applications. They work through some of the basic concepts including parent/child classes, final and abstract classes and interfaces.
</p> 
<blockquote>
In this article we're going to explore the idea of inheritance in object-oriented programming, and how inheritance works in PHP. With inheritance, your objects and classes can become much more powerful and flexible, and you can save a lot of time and effort with your coding.
</blockquote>
<p>
They start with the basics of how inheritance works and then move right into creating child classes from a parent. Their example code makes a basic forum system (just example code, not fully functioning) with administrators, members and forum creation. They use this as a base to show the method overriding and exposure with "final". The finish it off with examples of two things that can promote good application structure - abstract classes an interfaces.
</p>]]></description>
      <pubDate>Fri, 27 May 2011 09:21:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Create WordPress Plugins with OOP Techniques]]></title>
      <guid>http://www.phpdeveloper.org/news/16368</guid>
      <link>http://www.phpdeveloper.org/news/16368</link>
      <description><![CDATA[<p>
On NetTuts.com today there's a guide to help you <a href="http://net.tutsplus.com/tutorials/wordpress/create-wordpress-plugins-with-oop-techniques/">create WordPress plugins</a> with object-oriented code instead of procedural method. This means better encapsulation, reusability and more maintainable code.
</p>
<blockquote>
Object-oriented code, among other things, can help organize and add reusability to your code. In this tutorial, I will teach you the basics of writing a WordPress plugin using object oriented techniques. We'll be using Dribble's API as an example for this tutorial.
</blockquote>
<p>
They walk you through a brief explanation of OOP in WordPress plugins, setting up a shortcode, making a template tag and enabling this shortcode in the WordPress widgets. Their example grabs the latest shots from <a href="http://dribbble.com/">Dribble</a> with a getImage() method that fetches the results from their REST API.
</p>]]></description>
      <pubDate>Fri, 20 May 2011 11:28:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Developer Juice: PHP Magic Functions: Best Part of Object Oriented PHP - Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/16361</guid>
      <link>http://www.phpdeveloper.org/news/16361</link>
      <description><![CDATA[<p>
Web Developer Juice has posted <a href="http://www.webdeveloperjuice.com/2011/05/09/php-magic-functions-best-part-of-object-oriented-php-%E2%80%93-part-2/">the second part of their series</a> looking at some of the "magic functions" that PHP has to offer - special functions that do automagic things in your scripts and classes. Part one can be <a href="http://phpdeveloper.org/news/16288">found here</a>.
</p>
<blockquote>
In my <a href="http://www.webdeveloperjuice.com/2011/04/28/php-magic-functions-best-part-of-object-oriente-php/">previous post</a> ( PHP Magic Functions ), I discussed about __construct, __destruct, __call and __callStatic. Lets explore a few more magic functions...
</blockquote>
<p>In this latest part of the series they look at three functions:</p>
<ul>
<li>__set/__get
<li>__invoke
</ul>]]></description>
      <pubDate>Thu, 19 May 2011 10:14:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[James Cohen's Blog: Working with Date and Time in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16292</guid>
      <link>http://www.phpdeveloper.org/news/16292</link>
      <description><![CDATA[<p>
<i>James Cohen</i> has <a href="http://webmonkeyuk.wordpress.com/2011/05/04/working-with-date-and-time-in-php/">a new post to his blog</a> today looking at some of the built-in functionality that PHP has to work with dates and times including simple things like <a href="http://php.net/strtotime">strtotime</a> and the <a href="http://php.net/datetime">DateTime</a> feature.
</p>
<blockquote>
A lot of people ask questions relating to date and time in PHP. Here are some answers to the most commonly asked questions and common mistakes.
</blockquote>
<p>
He covers the differences between working with dates in strtotime, worrying about timezone settings and compares the strtotime/DateTime methods for formatting and returning dates, modifying dates, converting between timezones as well as finding the difference between two timezones. 
</p>]]></description>
      <pubDate>Wed, 04 May 2011 08:59:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Web Developer Juice: PHP Magic Functions: Best Part of Object Oriented PHP - Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/16288</guid>
      <link>http://www.phpdeveloper.org/news/16288</link>
      <description><![CDATA[<p>
On the Web Developer Juice blog there's a <a href="http://www.webdeveloperjuice.com/2011/04/28/php-magic-functions-best-part-of-object-oriente-php/">recent post</a>, the first part in a series</a> looking at one of the more handy features of the recent releases of PHP - the magic functions (some which were added in the PHP 5.x series).
</p>
<blockquote>
There are some reserved function names  in PHP class starting with __ ( double underscore ). These are <a href="http://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor">__construct</a>, <a href="http://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.destructor">__destruct</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__isset</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__unset</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods">__call</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods">__callStatic</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__sleep</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep">__wakeup</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__get</a>, <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.members">__set</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring">__toString</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.set-state">__set_state</a>, <a href="http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.invoke">__invoke</a> and <a href="http://www.php.net/manual/en/language.oop5.cloning.php">__clone</a>. You cannot use these functions to serve your logical purpose but these are meant to be used for providing magic functionality.
</blockquote>
<p>
They go through some of the above methods and talk about what role they can play in your code and, for some, a brief bit of code to explain how it works. This first part covers __construct/__destruct and __call/__callStatic.
</p>]]></description>
      <pubDate>Tue, 03 May 2011 11:57:08 -0500</pubDate>
    </item>
  </channel>
</rss>

