<?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, 06 Jul 2008 16:50:40 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DevShed: Defining Public and Protected Methods with Member Visibility in PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/10394</guid>
      <link>http://www.phpdeveloper.org/news/10394</link>
      <description><![CDATA[<p>
DevShed continues their series looking at variable scoping in PHP5 classes with <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/">this new look</a> at using the public and protected keywords to "restrict member visibility".
</p>
<blockquote>
Now that you know what will be treated in this fourth chapter of the series, it's time to learn how to declare and implement public and protected methods with PHP 5 classes. Of course, as always I'm going to address this useful topic by using a hands-on approach, which means that there's a bunch of code samples ahead, waiting patiently for you.
</blockquote>
<p>
They talk about calling methods <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/1/">globally</a> first and then move into the keyword restrictions. They show the difference between a public method/variable and a <a href="http://www.devshed.com/c/a/PHP/Defining-Public-and-Protected-Methods-with-Member-Visibility-in-PHP-5/2/">protected</a> one, including how to get at the protected members from a child class.
</p>]]></description>
      <pubDate>Thu, 12 Jun 2008 07:51:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Using Subclasses and Accessors with Member Visibility to Protect PHP 5 Class Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10343</guid>
      <link>http://www.phpdeveloper.org/news/10343</link>
      <description><![CDATA[<p>
DevShed has posted the <a href="http://www.devshed.com/c/a/PHP/Using-Subclasses-and-Accessors-with-Member-Visibility-to-Protect-PHP-5-Class-Data/">latest in their series</a> of tutorials covering the scoping keywords in PHP5 (public, private and protected). In this latest edition they work with private values from a parent class.
</p>
<blockquote>
In the last article, I explained how to work with a couple of private properties that partially comprised the API of a basic class, which is useful for saving simple strings to a specified text file.
</blockquote>
<p>
This part builds on this previous example but changes up the subclass (an instance of DataSaver) to use what they call an "accessor" - a function in the parent that returns the private variable/contstant's current value when called.
</p>]]></description>
      <pubDate>Thu, 05 Jun 2008 07:50:08 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Kimsal's Blog: PHP, Groovy and language evolution]]></title>
      <guid>http://www.phpdeveloper.org/news/10298</guid>
      <link>http://www.phpdeveloper.org/news/10298</link>
      <description><![CDATA[<p>
In a <a href="http://michaelkimsal.com/blog/php-groovy-and-language-evolution/">new post</a> <i>Michael Kimsal</i> does a good job comparing the rise of PHP5 (and what it brought with it) to his language of choice these days - <a href="http://groovy.codehaus.org/">Groovy</a>.
</p>
<blockquote>
I remember when PHP5 first came out having 'discussions' with a number of people who insisted that PHP5 was way better than 4. [...] Basically, intentions were made clearer with things like "public protected private" (PPP),but I have not yet seen any web project get done faster or dare I say even much *better* due to those sorts of things. [...] This isn't specifically saying PPP is necessarily bad, but that PHP could have addressed the issue in a fashion more suitable to dynamic languages.  Keep reading for an example.
</blockquote>
<p>
His comparison is to how Groovy handles properties in a class - everything is private unless declared otherwise. This could be ported (somewhat) over to PHP and would eliminate the need to search&replace all over the code for the right variables.
</p>]]></description>
      <pubDate>Thu, 29 May 2008 12:52:07 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Working with Private Properties to Protect PHP 5 Class Data]]></title>
      <guid>http://www.phpdeveloper.org/news/10292</guid>
      <link>http://www.phpdeveloper.org/news/10292</link>
      <description><![CDATA[<p>
DevShed continues their look at the use of the member visibility functionality PHP5 offers in its classes with <a href="http://www.devshed.com/c/a/PHP/Working-with-Private-Properties-to-Protect-PHP-5-Class-Data/">this new part</a> of the series, a look at the private property.
</p>
<blockquote>
One of the most useful features that was introduced into the improved object model of PHP 5 is "member visibility." It provides PHP developers with the ability to specify the level of access each data member of a class will have in the context of a given application.
</blockquote>
<p>
They <a href="http://www.devshed.com/c/a/PHP/Working-with-Private-Properties-to-Protect-PHP-5-Class-Data/1/">review</a> the other two keywords (public/protected) before venturing on to the <a href="http://www.devshed.com/c/a/PHP/Working-with-Private-Properties-to-Protect-PHP-5-Class-Data/2/">use of "private"</a> to protect, but allow access to, methods and properties in a parent class.
</p>]]></description>
      <pubDate>Thu, 29 May 2008 08:47:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Protecting PHP 5 Class Data with Member Visibility]]></title>
      <guid>http://www.phpdeveloper.org/news/10244</guid>
      <link>http://www.phpdeveloper.org/news/10244</link>
      <description><![CDATA[<p>
In <a href="http://www.devshed.com/c/a/PHP/Protecting-PHP-5-Class-Data-with-Member-Visibility/">this new tutorial</a> posted to DevShed, they take a look at working with classes in PHP5, specifically using the keywords for "member visibility" to make your classes a bit more structured.
</p>
<blockquote>
The previous concept can also be applied successfully when it comes to defining the visibility of properties and methods in PHP classes. [...] Using the jargon of object-oriented programming, this capacity is widely known as member visibility. This capacity allows PHP programmers to establish whether the set of methods and properties of a specific class will be public, protected, or private.
</blockquote>
<p>
They start more generally by looking at how to set up the variables <a href="http://www.devshed.com/c/a/PHP/Protecting-PHP-5-Class-Data-with-Member-Visibility/1/">globally</a> and then move down the line talking about <a href="http://www.devshed.com/c/a/PHP/Protecting-PHP-5-Class-Data-with-Member-Visibility/2/">restrictions</a> (private/protected/public) and how to <a href="http://www.devshed.com/c/a/PHP/Protecting-PHP-5-Class-Data-with-Member-Visibility/3/">get to them</a> in the scripts outside the class.
</p>]]></description>
      <pubDate>Thu, 22 May 2008 09:37:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPEveryDay.com: New Zend Framework Articles/Tutorials]]></title>
      <guid>http://www.phpdeveloper.org/news/10024</guid>
      <link>http://www.phpdeveloper.org/news/10024</link>
      <description><![CDATA[<p>
The PHP Every Day site has just posted a whole new list of tutorials that might interest Zend Framework developers:
</p>
<ul>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Creating-Switching-for-Front-Page-P570.html">Zend Framework Login: Creating Switching for Front Page</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Creating-Logout-P569.html">Zend Framework Login: Creating Logout</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Protected-Page-P568.html">Zend Framework Login: Protected Page</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Fatal-error-Cannot-use-object-of-type-stdClass-as-array-P567.html">Zend Framework Login: Fatal error Cannot use object of type stdClass as array</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Creating-Authentication-P566.html">Zend Framework Login: Creating Authentication</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Creating-Form-Login-P565.html">Zend Framework Login: Creating Form Login</a>
<li><a href="http://www.phpeveryday.com/articles/Zend-Framework-Login-Preparing-Database-P564.html">Zend Framework Login: Preparing Database</a>
</ul>
<p>
Check out <a href="http://www.phpeveryday.com/index.php">their site</a> (or grab <a href="http://feeds.feedburner.com/phpeveryday">their feed</a>) for more PHP-related articles and tutorials.
</p>]]></description>
      <pubDate>Wed, 23 Apr 2008 12:06:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Class Inheritance with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/9648</guid>
      <link>http://www.phpdeveloper.org/news/9648</link>
      <description><![CDATA[<p>
On PHPBuilder.com today, there's <a href="http://www.phpbuilder.com/columns/kris_hadlock20080215.php3">a new tutorial</a> that takes a beginning look at PHP5's class inheritance model.
</p>
<blockquote>
There are many benefits of inheritance with PHP, the most common is simplifying and reducing instances of redundant code. Class inheritance may sound complicated, but think of it this way. Consider a tree. A tree is made up of many parts, such as the roots that reside in the ground, the trunk, bark, branches, leaves, etc. Essentially inheritance is a connection between a child and its parent.
</blockquote>
<p>
They choose to go with a "car" illustration instead and <a href="http://www.phpbuilder.com/columns/kris_hadlock20080215.php3">show how</a> a child of the Product class (Car) can access the private properties of the parent. They also include an example of it in action with a bit of HTML output.
</p>]]></description>
      <pubDate>Mon, 18 Feb 2008 07:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Extending Singletons]]></title>
      <guid>http://www.phpdeveloper.org/news/7228</guid>
      <link>http://www.phpdeveloper.org/news/7228</link>
      <description><![CDATA[<p>
<i>Matthew Weir O'Phinney</i> <a href="http://weierophinney.net/matthew/archives/135-Extending-Singletons.html">wonders about singletons</a>. He wonders how he can make them more flexible than they even are by making entire custom singletons accessible later, after they've been created.
</p>
<blockquote>
This morning, I was wondering about how to extend a singleton class such that you could retrieve the new class when retrieving the singleton later. In particular, Zend_Controller_Front is a singleton, but what if I want to extend it later? A number of plugins in the Zend Framework, particularly view helpers and routing functionality, make use of the singleton; would I need to alter all of these later so I could make use of the new subclass?
</blockquote>
<p>
He gives two code examples to illustrate his point - one that uses the current Zend_Controller_Front implementation to extend an instance and the other with a slightly modified version to do the same. The change is in the declaration of the $_instance value. By making it protected, the differently extended instance will be created. With the normal setting (private) you'll only ever get back the same default Zend_Controller_Front instance.
</p>
<p>
Check out <a href="http://weierophinney.net/matthew/archives/135-Extending-Singletons.html#comments">the comments</a> for some other suggestions as well.
</p>]]></description>
      <pubDate>Tue, 06 Feb 2007 09:27:00 -0600</pubDate>
    </item>
  </channel>
</rss>
