<?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, 24 May 2013 17:31:16 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[QaFoo.com Blog: Struct classes in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/15792</guid>
      <link>http://www.phpdeveloper.org/news/15792</link>
      <description><![CDATA[<p>
On the QaFoo blog today there's <a href="http://qafoo.com/blog/016_struct_classes_in_php.html">a new post</a> looking at building struct classes in PHP (by <i>Kore Nordmann</i>) as a replacement - and a step up - from storing data in structures like arrays.
</p>
<blockquote>
In Apache Zeta Components and in several of my own projects we are using - so called - struct classes to solve this issue: The struct classes do not define any methods but just contain documented properties. They just deal as a data container, similar to a hash map.
</blockquote>
<p>
He mentions a few benefits and drawbacks to using this approach including the fact that, while they're easier to document and can make things clearer in your IDE, they also are objects and are passed by reference by default (leading to possible unintended behavior). That being said, he includes a sample implementation so you can judge for yourself. The example defines a Location with a city and state properties that extends a base Struct class.
</p>]]></description>
      <pubDate>Mon, 24 Jan 2011 09:59:22 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weir O'Phinney's Blog: Introducing Phly_Struct and Phly_Config]]></title>
      <guid>http://www.phpdeveloper.org/news/5407</guid>
      <link>http://www.phpdeveloper.org/news/5407</link>
      <description><![CDATA[<p>
<i>Matthew Weir O'Phinney</i> has created his own modules that he shares in <a href="http://weierophinney.net/matthew/archives/112-guid.html#extended">this post</a> today - one to manage the config data for the application and another to act as a bridge between the scripts and that configuration store.
</p>
<quote>
<i>
I often find myself needing a configuration module of some sort -- for storing application parameters, bootstrapping, template variables, what have you. The problem, however, is: once I bring them into my project, how can I access them? Better yet, would there be a way to bring in configurations of many types and still access them all in the same way?
</i>
</quote>
<p>
He looked into several of the methods out there, but wasn't pleased with any of them - so he <a href="http://weierophinney.net/matthew/archives/112-guid.html#extended">created his own</a>, the Phly_Struct and Phly_Config modules. He talks briefly about what they are, but gets quickly into the code examples to prove their worth. It's a basic example tying the two of them together and loading some simple values into an instance of the Phly_Config. Both are available from the <a href="http://weierophinney.net/phly/index.php">PHLY: PHP Library PEAR channel</a>.
</p>]]></description>
      <pubDate>Sat, 20 May 2006 10:01:28 -0500</pubDate>
    </item>
  </channel>
</rss>
