<?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>Wed, 09 Jul 2008 00:21:18 -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[Padraic Brady's Blog: ZF Blog Tutorial Part 10: Comments, reCAPTCHA and Akismet Filtering]]></title>
      <guid>http://www.phpdeveloper.org/news/10346</guid>
      <link>http://www.phpdeveloper.org/news/10346</link>
      <description><![CDATA[<p>
<i>Padraic Brady</i> has posted <a href="http://blog.astrumfutura.com/archives/376-Example-Zend-Framework-Blog-Application-Tutorial-Part-10-The-Public-Comment-System,-reCAPTCHA-and-Akismet-Filtering.html">part ten</a> in his series on the construction of a blogging system with the Zend Framework. This part of the series focuses on the commenting system and using a reCAPTCHA and Akismet system on it to prevent spam.
</p>
<blockquote>
Blogs all have two other features besides actual content. They allow readers to post comments, and they offer XML feeds of their content. With the blog application itself coming along nicely, and with Addendum #2's revised styling, it's a good time to take a peek at adding comments.
</blockquote>
<p>
He has created a custom Service component for the framework that interfaces directly with the <a href="http://recaptcha.net/">reCAPTCHA service</a> (along with a form helper, view helper and validation methods) so that an element can be added just like anything else in a form. Code of its use is included.
</p>
<p>
He works this into his comment form, including the Controller and the action that would be called. He shows how to attach an Akismet call to the form too via the framework's own service methods. Finally, he handles the other side of things - the administrative piece and displaying the (hopefully non-spam) comments back out on the post.
</p>]]></description>
      <pubDate>Thu, 05 Jun 2008 09:38:14 -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[PHP in Action: Public constructors considered harmful]]></title>
      <guid>http://www.phpdeveloper.org/news/10109</guid>
      <link>http://www.phpdeveloper.org/news/10109</link>
      <description><![CDATA[<p>
According to the PHP in Action blog, public constructors can be <a href="http://www.reiersol.com/blog/index.php?op=ViewArticle&articleId=34&blogId=1">hazardous to your (application's) health</a> and should be replaced.
</p>
<blockquote>
Everybody who writes object-oriented code knows about constructors. You need them so the program knows how to instantiate objects, right? And you especially need them when a lot of things have to be done while instantiating an object. [...] So why would I be skeptical of public constructors?
</blockquote>
<p>
The solution, as <a href="http://www.reiersol.com/blog/index.php?op=ViewArticle&articleId=34&blogId=1">he sees it</a>, is to make a "constructor" that's actually called statically with parameters that returns an instance of the class it's in as well as performing the action. He argues that this can help make the code much more readable for some types of method calls.
</p>]]></description>
      <pubDate>Mon, 05 May 2008 10:21:33 -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>
  </channel>
</rss>
