<?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>Fri, 04 Jul 2008 21:53:01 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Jaisen Methai's Blog: Stop including class files and use __autoload() instead]]></title>
      <guid>http://www.phpdeveloper.org/news/10530</guid>
      <link>http://www.phpdeveloper.org/news/10530</link>
      <description><![CDATA[<p>
On his blog, <i>Jaisen Methai</i> <a href="http://www.jaisenmathai.com/blog/2008/06/25/stop-including-class-files-and-use-__autoload-instead/">posted about</a> a very handy feature of PHP5 - the __autoload function.
</p>
<blockquote>
It's one of the gems in PHP that I find to be relatively under used.  It's common for PHP applications to break out classes into their own files.  This becomes cumbersome when working on large projects as you wind up with numerous include/require calls for any given page. 
</blockquote>
<p>
He shows an example of its usage (loading class files dynamically from a specified directory) and mentions how it can help to make your code a lot less ugly. Comments on <a href="http://www.jaisenmathai.com/blog/2008/06/25/stop-including-class-files-and-use-__autoload-instead/">the post</a> range in topics - from comparing it to include paths, how the idea was borrowed from PEAR, and how proper naming conventions can make its use even easier.
</p>]]></description>
      <pubDate>Wed, 02 Jul 2008 11:11:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Namespaces in PHP? Why *wouldn't* you want them?]]></title>
      <guid>http://www.phpdeveloper.org/news/10520</guid>
      <link>http://www.phpdeveloper.org/news/10520</link>
      <description><![CDATA[<p>
With more recent talk about namespaces in PHP 5.3, bloggers all over are tossing their comments into the discussion. <i>Chris Hartjes</i> is one of the latest with <a href="http://www.littlehart.net/atthekeyboard/2008/06/30/namespaces-in-php-why-wouldnt-you-want-them/">his thoughts</a> on the point of the functionality.
</p>
<blockquote>
I'm an outsider when it comes to tracking the going-on in the world of PHP internals. So, because of that, I'm not going to comment on the actual syntax of how namespaces will be implemented or it's impact on internals. That's not really important as far as this particular discussion goes. 
</blockquote>
<p>
He <a href="http://www.littlehart.net/atthekeyboard/2008/06/30/namespaces-in-php-why-wouldnt-you-want-them/">mentions</a> one of the primary arguments for namespaces from the casual developer's perspective - keeping things separate and so classes can have the same naming as some of their cousins in other namespaces. 
</p>]]></description>
      <pubDate>Tue, 01 Jul 2008 11:14:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Greg Beaver's Blog: PHP namespaces become much better (Derick take note)]]></title>
      <guid>http://www.phpdeveloper.org/news/10462</guid>
      <link>http://www.phpdeveloper.org/news/10462</link>
      <description><![CDATA[<p>
<i>Greg Beaver</i>, noting some issues that <i>Derick Rethans</i> had <a href="http://greg.chiaraquartet.net/exit.php?url_id=655&entry_id=193">pointed out</a> about namespace support for upcoming PHP versions, has <a href="http://greg.chiaraquartet.net/archives/193-PHP-namespaces-become-much-better-Derick-take-note.html">posted about</a> a patch he submitted to solve the problem simply.
</p>
<p>
The issue <i>Derick</i> pointed out:
</p>
<blockquote>
In PHP 5.3 this would alias the class Interval in the namespace PEAR::Date to the class Interval. For now, this code would work just fine. However, if PHP would introduce a class "Interval" at some point in the future (and PHP can do this as it <a href="http://greg.chiaraquartet.net/exit.php?url=aHR0cDovL3d3dy5waHAubmV0L21hbnVhbC9lbi91c2VybGFuZG5hbWluZy5ydWxlcy5waHA=&entry_id=193">owns the global namespace</a>) then the above code would suddenly stop working.
</blockquote>
<p>
<i>Greg</i>'s patch makes it possible to "override" the internal class if need be, making it so that code currently working wouldn't break. All it takes is to "use" is like you normally would and and the magic happens behind the scenes.
</p>]]></description>
      <pubDate>Mon, 23 Jun 2008 11:19:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ProDevTips Blog: Fluent Arrays and Strings in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10457</guid>
      <link>http://www.phpdeveloper.org/news/10457</link>
      <description><![CDATA[<p>
On the ProDevTips blog, <i>Henrik</i> has written up an <a href="http://www.prodevtips.com/2008/06/23/fluent-arrays-and-strings-in-php/">extensive tutorial</a> with plenty of code examples on working with something inspired by a few other languages - fluent arrays and strings.
</p>
<blockquote>
I've been working some with jQuery and Ruby lately, as you might know they both have very neat fluent interfaces for writing short and easily understandable code. Especially Ruby's array and string handling should be something that can be done in PHP so I started googling. [...] It's probably very possible that what I'm looking for is already part of some PHP framework or such but I didn't want to spend more time looking than being productive.
</blockquote>
<p>
Based on some Ruby examples, he defines a set of functions that can be use to create these fluent interfaces to the common PHP variable types (contained in a class for easy use). The entire source can be <a href="http://www.prodevtips.com/wp-content/uploads/2008/06/fluent.rar">downloded here</a>.
</p>]]></description>
      <pubDate>Mon, 23 Jun 2008 07:57:18 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP 10.0 Blog: duck operator]]></title>
      <guid>http://www.phpdeveloper.org/news/10352</guid>
      <link>http://www.phpdeveloper.org/news/10352</link>
      <description><![CDATA[<p>
In <a href="http://php100.wordpress.com/2008/06/05/duck-operator/">this new post</a> to the PHP 10.0 blog today, <i>Stas</i> talks about <a href="http://en.wikipedia.org/wiki/Duck_typing">duck typing</a>, a method that lets the code decide the functionality to use rather than a direct relation to a parent.
</p>
<blockquote>
Well, if you are into <a href="http://en.wikipedia.org/wiki/Duck_typing">duck typing</a> style of programming, it may be interesting for you to have an object that implements certain set of functions, but not necessary declares it at class definition. Languages like Smalltalk do it all day along, so why PHP couldn't?
</blockquote>
<p>
His example defines an interface Cow and a class MooingGrassEater and a function, CowConsumer, that does the work. A classname is passed in and an instance of that class is checked with "implements" rather than "instanceof" to see if it uses the Cow interface. He points out a place where PHP itself uses something similar in <a href="http://php.net/manual/en/function.stream-wrapper-register.php">user defined streams</a>.
</p>]]></description>
      <pubDate>Thu, 05 Jun 2008 14:36:31 -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[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[Kore Nordmann's Blog: PHPillow - a PHP CouchDB wrapper - Update]]></title>
      <guid>http://www.phpdeveloper.org/news/10256</guid>
      <link>http://www.phpdeveloper.org/news/10256</link>
      <description><![CDATA[<p>
<i>Kore Nordmann</i> has <a href="http://kore-nordmann.de/blog/phpillow_php_couchdb_wrapper.html">posted about</a> a PHP wrapper they've created to lay on top of <a href="http://couchdb.org/">CouchDB</a> - <a href="svn://arbitracker.org/phpillow/trunk">PHPillow</a>.
</p>
<blockquote>
The wrapper is called PHPillow, lays on top of the Couch and offers even more comfort laying anything into the database. :) It has complete API documentation, currently a test coverage of >95%, tutorials and practical examples included. Even I would call it alpha - as CouchDB is still alpha at the current state - you can expect it stay quite stable API wise, as I rely heavily on it in other projects and therefore won't break too much.
</blockquote>
<p>
You can check out the latest version of this wrapper from <a href="svn://arbitracker.org/phpillow/trunk">its subversion site</a> and get more information about CouchDB on its <a href="http://incubator.apache.org/couchdb/docs/overview.html">website</a> and <a href="http://wiki.apache.org/couchdb/">wiki</a>.
</p>]]></description>
      <pubDate>Fri, 23 May 2008 11:18:34 -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[ThinkPHP Blog: Accessing Nike+ data with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10191</guid>
      <link>http://www.phpdeveloper.org/news/10191</link>
      <description><![CDATA[<p>
On the ThinkPHP blog today, <i>Stephanie Ehrling</i> has <a href="http://blog.thinkphp.de/archives/323-Accessing-Nike+-data-with-PHP.html">posted about</a> a method for PHP to take in the output of the <a href="http://www.nike.com/nikeplus">Nike+ equipment</a> and put it into a usable form.
</p>
<blockquote>
There is no official API that allows you to use the raw data. Nevertheless the data are sent to the Flash via XML so there is a chance to use them. For PHP Rasmus Lerdorf himself has <a href="http://lerdorf.com/php/nikeplus.phps">implemented a class</a> to access these data. The class allows to authenticate a user and fetch the running data of a user in a XML-Format
</blockquote>
<p>
She gives an example of it in action - simple creation of an object then a call with the username and password. Behind the scenes, the data is pulled in and dropped into a SimpleXML object that includes total distance, total calories burned and data on the most recent run.
</p>]]></description>
      <pubDate>Thu, 15 May 2008 10:26:40 -0500</pubDate>
    </item>
  </channel>
</rss>
