<?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>Thu, 20 Nov 2008 12:33:33 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Eran Galperin's Blog: OO PHP Templating]]></title>
      <guid>http://www.phpdeveloper.org/news/11423</guid>
      <link>http://www.phpdeveloper.org/news/11423</link>
      <description><![CDATA[<p>
On the TechFounder blog, <i>Eran Galperin</i> has <a href="http://www.techfounder.net/2008/11/18/oo-php-templating/">taken a look</a> at object-oriented templating in PHP applications, comparing the older search and replace method with the inclusion of PHP-based templates.
</p>
<blockquote>
PHP as a language can be considered a templating system, as in its root it was meant to modify HTML pages dynamically. The need for more structured templating systems arose as PHP applications have grown more and more complex, giving birth to much more specialized and focused solutions.
</blockquote>
<p>
He illustrates with an object replacement example - parsing the template as a PHP script and replacing any objects found with the corresponding object property value.
</p>]]></description>
      <pubDate>Tue, 18 Nov 2008 13:05:30 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[IBM developerWorks: What's new in PHP V5.3, Part 1: Changes to the object interface]]></title>
      <guid>http://www.phpdeveloper.org/news/11396</guid>
      <link>http://www.phpdeveloper.org/news/11396</link>
      <description><![CDATA[<p>
<i>John Mertic</i> has put together a <a href="http://www.ibm.com/developerworks/opensource/library/os-php-5.3new1/index.html">what's new</a> list in the upcoming PHP 5.3 release:
</p>
<blockquote>
PHP V5.3 is set to be released by the end of 2008, and many of the new features in this release have been in the planning stages for a few years. Originally touted as "PHP V6 without native Unicode support," PHP V5.3 has been developed into a feature-rich upgrade to the PHP V5 line. [...] In this "What's new in PHP V5.3" series, we'll look at these new V5.3 features, and see how they are used and how they can be used in your Web application.
</blockquote>
<p>In this first part of the series he talks about:</p>
<ul>
<li>Improved static method and member handling
<li>The _callStatic() magic method
<li>Dynamic static calls
<li>Late static binding
<li>Standard PHP Library
<li>Circular garbage collection
</ul>]]></description>
      <pubDate>Wed, 12 Nov 2008 11:13:30 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint PHP Blog: How to Expose PHP's Private Parts]]></title>
      <guid>http://www.phpdeveloper.org/news/11385</guid>
      <link>http://www.phpdeveloper.org/news/11385</link>
      <description><![CDATA[<p>
On the SitePoint PHP Blog <i>Troels Knak-Nielsen</i> has <A href="http://www.sitepoint.com/blogs/2008/11/11/how-to-expose-phps-private-parts/">worked up a way</a> to "expose PHP's private parts" when it comes to finding out more about the object/variable he's working with (without a usual <a href="http://www.php.net/print_r">print_r</a> or <a href="http://www.php.net/var_dump">var_dump</a>).
</p>
<blockquote>
I've been tinkering with dumping PHP objects, and have found myself constantly running into a brick wall. The output from <a href="http://docs.php.net/manual/en/function.print-r.php">print_r</a> and friends is fine in some contexts, but for larger structures, it would be nice to tidy the output up a bit and wrap it in some HTML.
</blockquote>
<p>
His solution is to serialize the object into a string (keeping all related meta information) that can be passed around and parsed back into its original form for debugging. He's included the script that works bye taking in the string and manually parsing it back out into its parts into a useful array.
</p>]]></description>
      <pubDate>Tue, 11 Nov 2008 09:32:14 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[David Otton's Blog: Neat PHP Tricks: How To Assign References to Globals]]></title>
      <guid>http://www.phpdeveloper.org/news/11375</guid>
      <link>http://www.phpdeveloper.org/news/11375</link>
      <description><![CDATA[<p>
<i>David Otton</i> has a new <a href="http://www.otton.org/2008/11/09/neat-php-tricks-assign-references-globals-workaround/">neat PHP trick</a> posted today - assigning references to global values.
</p>
<blockquote>
What follows isn't so much a PHP trick as a fix for something that really should work, but doesn't. Although the manual implies that the behaviour described below is specific to Zend Engine 1, all my tests were performed against Zend Engine 2.2, PHP 5.2.5.
</blockquote>
<p>
His example compares making a new stdClass both with and without a reference on the it and <a href="http://www.php.net/var_dump">var_dumps</a> out the result. The method with the reference fails silently, however and isn't able to correctly assign it to the global. He recommends a work-around though - setting it directly to the $GLOBALS superglobal.
</p>]]></description>
      <pubDate>Mon, 10 Nov 2008 09:32:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Remote objects and Zend_Amf]]></title>
      <guid>http://www.phpdeveloper.org/news/11369</guid>
      <link>http://www.phpdeveloper.org/news/11369</link>
      <description><![CDATA[<p>
On PHPBuilder.com <i>Richard Bates</i> has <a href="http://www.phpbuilder.com/columns/richard_bates20081107.php3">continued his series</a> introducing the Zend_Amf component of the Zend Framework and how to get a sample project setup that uses it.
</p>
<blockquote>
Last week we discussed the new Zend Framework extension and gave you a look inside its functionality. This week we take off where we ended last week, and delve into remote objects and Zend_Amf!
</blockquote>
<p>
The tutorial walks you through the setup of a new project, the PHP code behind it and how to get the two talking back and forth through a RemoteObject. Screenshots and complete code are included.
</p>]]></description>
      <pubDate>Fri, 07 Nov 2008 13:40:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Using Data Objects with PHP and DB_OO2]]></title>
      <guid>http://www.phpdeveloper.org/news/11292</guid>
      <link>http://www.phpdeveloper.org/news/11292</link>
      <description><![CDATA[<p>
<a href="http://devzone.zend.com/article/3985-Using-Data-Objects-with-PHP-and-DB_OO2">This new tutorial</a> from the Zend Developer Zone (by <i>Vikram Vaswani</i>) looks at getting data objects set up between PHP and the DB_OO2 package.
</p>
<blockquote>
Data objects, which provide an API for accessing and manipulating database tables, are one such tool. There are a number of implementations for data objects in PHP, most notably the popular PEAR DB_DataObject package. This tutorial focuses on one such implementation, the DB_OO2 package, showing you how it can significantly reduce your coding time when working with database tables.
</blockquote>
<p>
The <a href="http://pear.sergiocarvalho.com/packages/package/DB_OO2/">DB_OO2 package</a> (PEAR) lets you set up references to your database tables as objects and interface with them by setting properties and calling standardized functions. Many of the PHP frameworks out there let you do this same sort of thing, but those are built in - this method lets you use the package wherever.
<?p>]]></description>
      <pubDate>Mon, 27 Oct 2008 10:28:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPClasses.org: PHP Object-Relational Mapping: ORM or ROM?]]></title>
      <guid>http://www.phpdeveloper.org/news/11186</guid>
      <link>http://www.phpdeveloper.org/news/11186</link>
      <description><![CDATA[<p>
On the PHPClasses.org blog today <i>Manuel Lemos</i> has <a href="http://www.phpclasses.org/blog/post/82-PHP-ObjectRelational-Mapping-ORM-or-ROM.html">posted a look</a> at ORM - what it is and how you can use it to improve your applications.
</p>
<blockquote>
Object-Relational Mapping, usually referred as ORM, is a software development approach to treat data stored in relational (SQL) database table records as if they were objects. Basically we can create classes with variables that represent fields of a database table. To insert a table record you need to create an object of the class, assign the variable values, and call a function of the class that takes care of inserting the table record
</blockquote>
<p>
He illustrates what it is (brief code samples) and some of the approaches that developers have taken to implementing it. He suggests, however, that they should truely be called ROM (Relational Object Mapping) libraries rather than ORM due to the fact that they map an object (the database tables) back in to PHP objects. He finishes with a list of a few ORM resources and libraries including the one that helps power the PHPClasses website, <a href="http://www.metastorage.net/">Metastorage</a>.
</p>]]></description>
      <pubDate>Fri, 10 Oct 2008 12:09:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Solar Blog: Using registry_set to auto-register objects]]></title>
      <guid>http://www.phpdeveloper.org/news/11065</guid>
      <link>http://www.phpdeveloper.org/news/11065</link>
      <description><![CDATA[<p>
In <a href="http://solarphp.com/blog/read/8-using-registry-set-to-auto-register-objects">this recent post</a> from the Solar blog, <i>anttih</i> shows how to use the Solar registry to automatically load and register objects when it starts up.
</p>
<blockquote>
<a href="http://solarphp.com/class/Solar_Registry">Solar_Registry</a> is a class for storing singleton objects which are used usually for things like SQL objects and the response and request objects. Now what's interesting, is that in the new version of Solar a new configuration key registry_set was added for the <a href="http://solarphp.com/class/Solar">Solar</a> arch-class. You can use it to tell Solar to automatically add objects to the registry when it starts up.
</blockquote>
<p>
He compares the two methods - manual loading and the automatic version and includes a "real world" example of loading up an SMTP object.
</p>]]></description>
      <pubDate>Tue, 23 Sep 2008 08:47:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[ParticleTree.com: Object Oriented Memory Concerns]]></title>
      <guid>http://www.phpdeveloper.org/news/11039</guid>
      <link>http://www.phpdeveloper.org/news/11039</link>
      <description><![CDATA[<p>
In a <a href="http://particletree.com/notebook/object-oriented-php-memory-concerns/">new article</a> to his blog, <i>Ryan Campbell</i> has expressed some concerns in the amounts of memory that some of the object oriented practices in PHP are using these days.
</p>
<blockquote>
It's hard to imagine pushing the limits of object oriented PHP so far that your web servers choke, but the truth is those limits are reached faster than you think. [...] While replacing objects with arrays when possible makes things a little better, the most performance friendly approach involves appending strings. For your convenience, we've run some tests that measure page execution times and memory usage to create the following guideline to help you plan out what areas of your code may have to break away from an object oriented nature.
</blockquote>
<p>
He shares some <a href="http://particletree.com/notebook/object-oriented-php-memory-concerns/">benchmarks</a> of the memory use for different variable types - strings, arrays and objects - giving load times and the amounts of memory used. He mentions three workarounds that could help (unset, static methods and paging) reduce the memory consumption of your script.
</p>]]></description>
      <pubDate>Thu, 18 Sep 2008 11:17:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP in Action: Type hints are more useful for scalars than objects]]></title>
      <guid>http://www.phpdeveloper.org/news/11002</guid>
      <link>http://www.phpdeveloper.org/news/11002</link>
      <description><![CDATA[<p>
On the PHP in Action blog, there's a <a href="http://www.reiersol.com/blog/1_php_in_action/archive/160_type_hints_are_more_useful_for_scalars_than_objects.html">new post</a> looking at a <a href="http://www.maxhorvath.com/2008/09/type-hints-for-scalar-values-phptypesafe-10-rc2-released.html">recent library</a> that was posted to support type hinting on scalars. They agree with his choice of subjects, noting that they see type hinting as much more useful on scalars than on objects.
</p>
<blockquote>
I admit that these judgments are hard to make. I could be wrong, more or less. Type hints are probably useful when code becomes stable enough and at the boundaries between modules. But I still tend to avoid using them until I get an actual bug that might have been prevented by a type hint. Their usefulness is and has to be an empirical question. The purpose of using them has to be catching errors earlier, so if they don't have that effect, there's no point.
</blockquote>
<p>
He lists three reasons why he had given up on type hinting before, one being the limited usefulness when it came to objects. Applying it to scalars is a different matter, though, and can prevent improper passing of array/scalars when the other is needed.
</p>]]></description>
      <pubDate>Thu, 11 Sep 2008 10:08:33 -0500</pubDate>
    </item>
  </channel>
</rss>
