<?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, 22 May 2013 06:48:38 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michael Girouard's Blog: FIEO with PHP 5 Interceptors]]></title>
      <guid>http://www.phpdeveloper.org/news/9001</guid>
      <link>http://www.phpdeveloper.org/news/9001</link>
      <description><![CDATA[<p>
<i>Michael Girouard</i> has a <a href="http://www.lovemikeg.com/blog/2007/10/30/feio-with-php-5-interceptors/">post on his blog</a> about something that's becoming more and more wide-spread in the PHP community (thankfully) - filtering input from users and escaping the output to ensure the safety of your application.
</p>
<blockquote>
The idea itself is simple. When data comes into your application, it must be filtered prior to it actually being used for any reason. This means all data. Form values, URL values, and yes, even the values in the forever useful $_SERVER superglobal. [...] Before leaving your application, data should be properly escaped with the specific output medium in mind. 
</blockquote>
<p>
<a href="http://www.lovemikeg.com/blog/2007/10/23/the-abstract-collection/">Previously</a> he showed how, using an interceptor method in PHP5, you could build "collections of data". He uses the same sort of method here, appling custom filters to the data based on the output call. Code is included for both the filtering interface and two example filters - one for SQL and the other for HTML.
</p>
<p>
You can also <a href="http://www.lovemikeg.com/downloads/DataFilter.php.txt">grab the code</a> if you just want to play with that.
</p>]]></description>
      <pubDate>Thu, 08 Nov 2007 08:41:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Tobias Schlitt's Blog: Virtual Properties]]></title>
      <guid>http://www.phpdeveloper.org/news/7813</guid>
      <link>http://www.phpdeveloper.org/news/7813</link>
      <description><![CDATA[<p>
In response to <a href="http://www.phpdeveloper.org/news/7812">this previous post</a> from <i>Jeff Moore</i>, <i>Tobias Schlitt</i> <a href="http://schlitt.info/applications/blog/index.php?/archives/547-Virtual-properties.html">shares some of his own comments</a> on the subject - mainly that he wholeheartedly agrees.
</p>
<blockquote>
The usage of interceptors (<a href="http://de.php.net/manual/en/language.oop5.overloading.php">__get()/__set()/__isset()/__call()</a>) makes your API a lot more readable and comfortable, while maintaining the purpose behind getters and setters: Checking the correctness of values assigned to a property and wrapping around retrieval mechanisms for a property. I personally call the way of maintaining value-correctness for properties through interceptors virtual properties, which fits quite nice I think.
</blockquote>
<p>
<i>Tobias</i> gives an example of what he means by these "virtual properties" with <a href="http://schlitt.info/applications/blog/index.php?/archives/547-Virtual-properties.html">an illustration</a> from something widely used on the <a href="http://ez.no/ezcomponents">eZ Components</a> libraries - comparing one method of setting text to an object to another (just setting versus the wrappers).
</p>]]></description>
      <pubDate>Thu, 10 May 2007 07:57:00 -0500</pubDate>
    </item>
  </channel>
</rss>
