<?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>Tue, 14 Oct 2008 14:30:03 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Christian Weiske's Blog: Importing huge XML files using PHP5 - efficiently and conveniently]]></title>
      <guid>http://www.phpdeveloper.org/news/10889</guid>
      <link>http://www.phpdeveloper.org/news/10889</link>
      <description><![CDATA[<p>
<i>Christian Weiske</i> has a <a href="http://cweiske.de/tagebuch/Importing%20huge%20XML%20files%20using%20PHP5%20-%20efficiently%20and%20conveniently.htm">quick tip</a> on how to get larger XML files to pull into PHP5 and be usable:
</p>
<blockquote>
At work I had the task to implement the synchronization between an online shop and a commodity management system. Data exchange format was XML - one big XML file for all of the products (some thousands with dozens of attributes). Big question: How do I import the file in a way that is most convenient for me as a programmer - and without exceeding the machine's RAM when loading a 1 GiB file?
</blockquote>
<p>
The newer alternatives both use the same technology (DOM and SimpleXML - with DOM behind it) so he goes more "low tech" than that and opts for the XMLReader extension to pull in the large amounts of data. Available in PHP5, the XMLReader extension, which he combines with an Iterator from the SPL to makes for a simple, quick little parser.
</p>]]></description>
      <pubDate>Mon, 25 Aug 2008 09:34:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ibuildings Blog: Implementing Iterators]]></title>
      <guid>http://www.phpdeveloper.org/news/10870</guid>
      <link>http://www.phpdeveloper.org/news/10870</link>
      <description><![CDATA[<p>
On the Ibuildings blog <i>Ruud Alberts</i> <a href="http://www.ibuildings.com/blog/archives/1241-Implementing-Iterators.html">takes a look</a> at iterators - what they are and how they're used (including the objects the SPL makes available).
</p>
<blockquote>
Let's kickstart this blogpost by defining what an iterator actually is. According to wikipedia, an iterator is. A collection can pretty much be anything. The most obvious sources would be arrays, but other than that, iterations can be done over database resultsets, strings, datetime intervals, directories, file content and XML listings, to name a few.
</blockquote>
<p>
He looks at the iterator interface that comes bundled in the <a href="http://www.php.net/~helly/php/ext/spl/">SPL</a> and how you can create a custom one to loop through your own data collection. He includes an example - a colorful string iterator that "pretties up" an HTML string with various colors.
</p>]]></description>
      <pubDate>Wed, 20 Aug 2008 15:02:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPImpact Blog: 5 great articles on SPL Iterators]]></title>
      <guid>http://www.phpdeveloper.org/news/10781</guid>
      <link>http://www.phpdeveloper.org/news/10781</link>
      <description><![CDATA[<p>
On the PHP::Impact blog today <i>Federico</i> <a href="http://phpimpact.wordpress.com/2008/08/06/5-great-articles-on-spl-iterators/">points out</a> five articles that can help you learn more about the Standard PHP Library, specifically in dealing with iterators.
</p>
<blockquote>
When PHP 5 was initially released, it included a strong sense of standardization introduced in the core package. This can be a real time saver when common programming issues must be solved through proven, standard solutions. That's precisely the case with iterators, since the SPL package includes many predefined iterating classes that can be used for traversing different data structures, without having to reinvent the wheel over and over again.
</blockquote>
<p>
The links include <a href="http://www.phpro.org/tutorials/Introduction-to-SPL.html">this article</a> on phpro.org and <a href="http://devzone.zend.com/article/2565-the-standard-php-library-spl">this one</a> on Zend's own site.
</p>]]></description>
      <pubDate>Thu, 07 Aug 2008 09:35:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Havard Eide's Blog:  Countable]]></title>
      <guid>http://www.phpdeveloper.org/news/10739</guid>
      <link>http://www.phpdeveloper.org/news/10739</link>
      <description><![CDATA[<p>
In a <a href="http://eide.org/2008/07/30/countable/">new post</a> <i>Havard Eide</i> looks at the creation of a Countable interface that can be used in any application:
</p>
<blockquote>
Today I will look at the Countable interface, it has a single function that needs to be implemented: count(), by implementing this you can ensure that there is a count() function ready to use on any given class that implements it. The Countable interface is used in other places in the SPL as well: the ArrayIterator and ArrayObject classes implements this interface ( and SqliteResult if present ).
</blockquote>
<p>
In his code examples he shows simple methods for returning the count() of a property, but notes that the real power of it comes in the ability to manipulate the number returned from the call based on other parameters (or filtering).
</p>]]></description>
      <pubDate>Fri, 01 Aug 2008 10:23:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Turland's Blog: Environmental Awareness Quickie]]></title>
      <guid>http://www.phpdeveloper.org/news/10691</guid>
      <link>http://www.phpdeveloper.org/news/10691</link>
      <description><![CDATA[<p>
<i>Matthew Turland</i> <a href="http://ishouldbecoding.com/2008/07/26/environmental-awareness-quickie">came across</a> someone having an issue running his PHP-based IRC bot (<a href="http://phergie.org/">Phergie</a>) an an environment where the <a href="http://www.php.net/exec">exec function</a> wasn't allowed:
</p>
<blockquote>
This causes a warning in the <a href="http://trac2.assembla.com/phergie/browser/trunk/Phergie/Plugin/Quit.php">Quit</a> plugin, which uses exec to automatically detection of the full path to the PHP CLI binary on non-Windows systems that it will later use that path to initiate a new PHP CLI process to "restart" the bot.
</blockquote>
<p>
It check this setting for the future, it was recommended that he look at the <a href="http://us3.php.net/manual/en/language.oop5.reflection.php#language.oop5.reflection.reflectionfunction">SPL ReflectionFunction class</a> (a part of the Standard PHP Library) that would let him check the disabled status of any PHP function (looking at the result of the isDisabled call).
</p>]]></description>
      <pubDate>Mon, 28 Jul 2008 07:57:00 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Eran Gelperin's Blog: Operator overloading in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/10562</guid>
      <link>http://www.phpdeveloper.org/news/10562</link>
      <description><![CDATA[<p>
<i>Eran Gelperin</i> gives <a href="http://www.techfounder.net/2008/07/08/operator-overloading-in-php/">an overview</a> of the current state of overloading abilities PHP has in a new blog post today:
</p>
<blockquote>
<a href="http://en.wikipedia.org/wiki/Operator_overloading">Operator overloading</a> is a programming language features that allows operators to act differently depending on the type of data they are operating on. Since OOP lets us create custom types (classes), there are plenty of opportunities to do useful and interesting code manipulations using operator overloading.
</blockquote>
<p>
He talks about <a href="http://www.php.net/oop5.magic">magic functions</a>, the additions that the <a href="http://www.php.net/~helly/php/ext/spl/">SPL</a> made, the PECL addition <a href="http://pecl.php.net/package/operator">operator</a> and how much its <a href="http://blog.phpdoc.info/archives/2-PHP-5.1-Babble.html">currently being discussed</a> on the PHP internals list.
</p>]]></description>
      <pubDate>Tue, 08 Jul 2008 10:29:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Etienne Kneuss' Blog: SplFastArray to speed up your PHP arrays]]></title>
      <guid>http://www.phpdeveloper.org/news/10371</guid>
      <link>http://www.phpdeveloper.org/news/10371</link>
      <description><![CDATA[<p>
<i>Etienne Kneuss</i> has <a href="http://www.colder.ch/news/06-07-2008/33/splfastarray-to-speed-up-.html">posted about</a> a new part of the Standard PHP Library that creates arrays that are up to thirty percent faster than normal methods - SplFastArray.
</p>
<blockquote>
Antony got the idea to implement a C-like array wrapper in SPL: SplFastArray. The main advantage of that class is performance, it's indeed faster than PHP arrays. How so? No free lunch: The speedup comes from the fact that non-numeric indexes are not allowed and that the array is of fixed size.
</blockquote>
<p>
The code sample shows the setting of the size for the array (and changing it) with a var_dump of the output result. This method is always faster than normal arrays, it just varies how much from system to system (anywhere from ten to thirty percent).
</p>]]></description>
      <pubDate>Mon, 09 Jun 2008 12:54:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Simple Zend_Form File Upload Example Revisited]]></title>
      <guid>http://www.phpdeveloper.org/news/10210</guid>
      <link>http://www.phpdeveloper.org/news/10210</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/2008/05/16/simple-zend_form-file-upload-example-revisited/">revisited</a> a Zend_Form example he had created before, updating it with a fix for a common error people were seeing when the form tries to validate.
</p>
<blockquote>
I've been thinking about the <a href="http://akrabat.com/2008/04/07/simple-zend_form-file-upload-example/">Simple Zend_Form File Upload Example</a> that I discussed last month. To recap, if you haven't read the comments, if the form fails to validate for some reason then you get a nasty error.
</blockquote>
<p>
He corrects the issue by creating an ArrayObject (thanks to the SPL) that can be used both as an array and can look like a string to htmlspecialchars and changing up the validation a little bit to work with the new object.
</p>]]></description>
      <pubDate>Mon, 19 May 2008 09:33:13 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Etienne Kneuss' Blog: SPL Datastructures updated]]></title>
      <guid>http://www.phpdeveloper.org/news/10170</guid>
      <link>http://www.phpdeveloper.org/news/10170</link>
      <description><![CDATA[<p>
<i>Etienne Kneuss</i> has <a href="http://www.colder.ch/news/05-12-2008/32/spl-datastructures-update.html">posted about</a> some updates to the data structures functionality in the Standard PHP Library (SPL), specifically some new additions.
</p>
<blockquote>
There finally is documentation for SplDoublyLinkedList, SplStack and SplQueue and some "new" classes: SplHeap (abstract), SplMaxHeap, SplMinHeap and SplPriorityQueue, documentation of those classes is in progress.
</blockquote>
<p>
An example of the new functionality (for SplPriorityQueue) is included in the post showing the insertion of a value into a pre-existing array (without having to slice or splice!).
</p>]]></description>
      <pubDate>Tue, 13 May 2008 09:31:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Developer Tutorials Blog: Iterating PHP objects, and readable code too!]]></title>
      <guid>http://www.phpdeveloper.org/news/10124</guid>
      <link>http://www.phpdeveloper.org/news/10124</link>
      <description><![CDATA[<p>
The Developer Tutorials blog has a <a href="http://www.developertutorials.com/blog/php/iterating-php-objects-spl-iterato-150/">recent post</a> that talks about manipulating objects in PHP with the help of the iterators that the Standard PHP Library has to offer.
</p>
<blockquote>
It's a generally accepted fact that more readable code is more maintainable and easier for other developers to pick up. [...] Today I'm going to take a look at object iteration, most commonly found in the Standard PHP Library, and explore using the Iterator interface to simplify looping.
</blockquote>
<p>
<a href="http://www.developertutorials.com/blog/php/iterating-php-objects-spl-iterato-150/">The main part</a> of the tutorial shows how to implement the Iterator interface of the SPL to create your own custom methods, theirs being a Database version with methodsfor rewinding, reading and getting the current record you're working with.
</p>]]></description>
      <pubDate>Tue, 06 May 2008 14:34:58 -0500</pubDate>
    </item>
  </channel>
</rss>
