<?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, 21 May 2013 14:58:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen: Thoughts on module directory structure]]></title>
      <guid>http://www.phpdeveloper.org/news/18991</guid>
      <link>http://www.phpdeveloper.org/news/18991</link>
      <description><![CDATA[<p>
<i>Rob Allen</i>, in his Zend Framework 2 development, has <a href="http://akrabat.com/zend-framework-2/thoughts-on-module-directory-structure/">come up with a list of suggestions</a> about the use of modules in your applications, mainly relating to the structure of the files inside of them.
</p>
<blockquote>
I've been working on a Zend Framework 2 module within a larger project that doesn't have that many PHP class files. Specifically, it has a controller, a mapper, an entity, a service and a form. As a result, the traditional Zend Framework 2 directory structure for the Account module looks [overly complicated]. That's a lot of directories for not many files! As a result, I decided to flatten it to [something simpler].
</blockquote>
<p>
He includes both the "before" and "after" directory structures and continues on with two more suggestions - the removal of the top level "Account" folder inside of "src/" and, finally, removing "src/" all together with a slight modification to the autoloading. With a simpler module, though, something like this might make it easier to maintain and "follow" later down the road.
</p>]]></description>
      <pubDate>Fri, 04 Jan 2013 09:09:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: List Files and Directories with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/18644</guid>
      <link>http://www.phpdeveloper.org/news/18644</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial showing you how to <a href="http://phpmaster.com/list-files-and-directories-with-php/">work with files and directories</a> through your PHP applications. 
</p>
<blockquote>
In this article I'll talk about a common task you might have experienced while developing a PHP application: listing files and directories. I'll discuss several basic and advanced solutions, each having its pros and cons. First I'll present three approaches that use some very basic PHP functions and then progress to more robust ones which make use of SPL Iterators.
</blockquote>
<p>
The solutions they look at are the built-in functions like <a href="http://php.net/glob">glob</a> and <a href="http://php.net/readdir">readdir</a>/<a href="http://php.net/opendir">opendir</a> as well as SPL iterators up for the task - FilesystemIterator, RecursiveDirectoryIterator and GlobIterator. Code samples are included in the post, showing how to use each method to get and list the files. A few helpful hints are also included to finish off the tutorial (mostly about "tricks" to using the functions effectively).
</p>]]></description>
      <pubDate>Tue, 23 Oct 2012 08:56:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Using SPL Iterators, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17962</guid>
      <link>http://www.phpdeveloper.org/news/17962</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial posted, the first part of a series, looking at the use of the <a href="http://php.net/spl">Standard PHP Library (SPL)</a> in PHP. In <a href="http://phpmaster.com/using-spl-iterators-1/">this first part</a> of the series, <i>Stefan Froelich</i> looks specifically at two of the more common uses for iterators - working with arrays and directories.
</p>
<blockquote>
When I first came across the term iteration and saw the overwhelming list of classes related to it in the SPL, I was taken aback. It seemed maybe iteration was too complex for me to grasp. I soon realized it was just a fancy word for something we programmers do all the time. [...] In the first part of this two-part series I'll introduce you to iteration and how you can take advantage of some of the built-in classes from the Standard PHP Library (SPL).
</blockquote>
<p>
Included in the tutorial is example code showing how to use the <a href="http://php.net/arrayiterator">ArrayIterator</a> to work with an array and the <a href="http://php.net/directoryiterator">DirectoryIterator</a> to process the contents of a directory. He also briefly touches on a few other iterators like "FileExtensionFilter", "RecursiveDirectoryIterator" and "RecursiveArrayIterator".
</p>]]></description>
      <pubDate>Tue, 15 May 2012 12:26:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Job Posting: Worldwide Travel Directory Seeks LAMP Consultant (New York City, NY)]]></title>
      <guid>http://www.phpdeveloper.org/news/15135</guid>
      <link>http://www.phpdeveloper.org/news/15135</link>
      <description><![CDATA[<table cellpadding="3" cellspacing="2" border="0">
<tr>
	<td style="font-weight:bold;vertical-align:top;font-size:11px">Company</td>
	<td style="font-size:11px">Worldwide Travel Directory</td>
</tr>
<tr>
	<td style="font-weight:bold;vertical-align:top;font-size:11px">Location</td>
	<td style="font-size:11px">New York City, NY (Downtown)</td>
</tr>
<tr>
	<td style="font-weight:bold;vertical-align:top;font-size:11px">Title</td>
	<td style="font-size:11px">LAMP Consultant</td>
</tr>
<tr>
	<td style="font-weight:bold;vertical-align:top;font-size:11px">Summary</td>
	<td style="font-size:11px">
	<p>
	A worldwide travel directory is seeking a sharp and well-qualified LAMP consultant to work on an online reservation system. This is an outstanding temporary opportunity for a highly analytical IT professional with substantial e-commerce experience, to join a advanced and growing atmosphere! Please consider this position by applying today for immediate consideration.
	</p>
<p>
<b>NOTE</b>: Position is contract but could become long-term/permanent for the right fit.
</p>
	<p><b>Company Description</b><br/>
	Worldwide Travel Directory
	</p>
	<p><b>Job Description</b><br/>
	In this short-term, temporary position, the LAMP Consultant will work on an online reservation for a worldwide travel directory. Candidates must come from an e-commerce background and have 5+ years of programming experience with Linux, Apache HTTP Server, MySQL, and PHP.
	</p>
	<p><b>Required Skills</b></p>
	<ul>
	<li>5+ years of programming experience with Linux, Apache HTTP Server, MySQL, and PHP
	<li>Substantial e-commerce experience
	<li>Excellent written and verbal communication skills
	<li>Strong ability to work autonomously
	<li>Highly analytical
	<li>Experience with all phases of application development from initial design through deployment
	<li>Ability to interpret and analyze existing code base
	</ul>
	<p><b>Desired Skills</b></p>
	<ul>
	<li>Experience in developing mobile apps
	<li>Prior exposure to online booking and travel development. i.e. Expedia, Travelocity,  or similar
	</p>
	<p>
	For more information or to submit your resume, contact Michael J. Pisano at MPisano@execu-search.com.
	</p>
	</td>
</tr>
</table>]]></description>
      <pubDate>Wed, 15 Sep 2010 12:29:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Matthew Weier O'Phinney's Blog: Applying FilterIterator to Directory Iteration]]></title>
      <guid>http://www.phpdeveloper.org/news/14972</guid>
      <link>http://www.phpdeveloper.org/news/14972</link>
      <description><![CDATA[<p>
New on his blog <i>Matthew Weier O'Phinney</i> has <a href="http://weierophinney.net/matthew/archives/244-Applying-FilterIterator-to-Directory-Iteration.html">this post</a> looking about using the FilterIterator (from PHP's SPL libraries) to work with (recursive) directory iteration.
</p>
<blockquote>
I'm currently doing research and prototyping for autoloading alternatives in Zend Framework 2.0. One approach I'm looking at involves creating explicit class/file maps; these tend to be much faster than using the include_path, but do require some additional setup. [...] I'm well aware of RecursiveDirectoryIterator, and planned to use that. However, I also had heard of FilterIterator, and wondered if I could tie that in somehow. In the end, I could, but the solution was non-obvious. 
</blockquote>
<p>
He starts with what he thought he should be able to do with the FilterIterator - pass in a DirectoryIterator to be able to filter them recursively. Unfortunately this only worked for the first level, so he looked else where. His solution ultimately involved passing in a RecursiveIteratorIterator instance into the DirectoryIterator that contained his RecursiveDirectoryIterator. He includes a full code example in the post showing how to locate a certain file/class recursively inside a directory.
</p>]]></description>
      <pubDate>Tue, 17 Aug 2010 10:29:38 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rafael Dohms' Blog: Iterating over life with SPL Iterators I: Directories]]></title>
      <guid>http://www.phpdeveloper.org/news/13358</guid>
      <link>http://www.phpdeveloper.org/news/13358</link>
      <description><![CDATA[<p>
<i>Rafael Dohms</i> has <a href="http://www.rafaeldohms.com.br/2009/10/08/iterating-over-life-with-spl-iterators-i/en/">posted the first part of a series</a> he's writing looking at the Iterators that come with the Standard PHP Library (SPL). In this first article he focuses on Directory iterators.
</p>
<blockquote>
Wouldn't it be nice if you could go by life just applying a foreach to each year and life day by day? Ok, that was an awful joke, but using iterators does make life a lot easier and fun, and that's without mentioning cleaner code. SPL's iterator classes are really awesome and helpful, replacing multiple lines of code and a handful functions with a simple new this and a foreach can really help cleaning up code.
</blockquote>
<p>
He looks at both the <a href="http://www.php.net/%7Ehelly/php/ext/spl/classDirectoryIterator.html">DirectoryIterator</a> and the <a href="http://www.php.net/%7Ehelly/php/ext/spl/classRecursiveDirectoryIterator.html">RecursiveDirectoryIterator</a> with code examples to go with each.
</p>]]></description>
      <pubDate>Thu, 08 Oct 2009 11:57:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Using Directory Iterators to Build Loader Apps in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/12812</guid>
      <link>http://www.phpdeveloper.org/news/12812</link>
      <description><![CDATA[<p>
DevShed finishes off their "loader" series of tutorials today with <a href="http://www.devshed.com/c/a/PHP/Using-Directory-Iterators-to-Build-Loader-Apps-in-PHP/">this eighth part</a> focusing on the use of Directory Iterators.
</p>
<blockquote>
Here's where the SPL comes in, since it's possible to use a combination of its "spl_autoload_register()" function and its RecursiveDirectoryIterator class to refactor the method in question and make it shorter and tighter. In this final chapter of the series I'm going to improve the loader class developed in the previous one by incorporating some of the aforementioned SPL functions and classes.
</blockquote>
<p>
They change up <a href="http://www.devshed.com/c/a/PHP/Using-Directory-Iterators-to-Build-Loader-Apps-in-PHP/2/">their code</a> to use a RecursiveDirectoryIterator inside of their __autoload to remove their custom recursive code.
</p>]]></description>
      <pubDate>Mon, 06 Jul 2009 10:17:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tiffany Brown's Blog: Simple pagination for arrays with PHP 5]]></title>
      <guid>http://www.phpdeveloper.org/news/11569</guid>
      <link>http://www.phpdeveloper.org/news/11569</link>
      <description><![CDATA[<p>
<i>Tiffany Brown</i> has a <a href="http://tiffanybbrown.com/2008/12/14/simple-pagination-for-arrays-with-php-5/">quick tutorial</a> on a pagination method she's come up with for splitting out array contents over multiple pages.
</p>
<blockquote>
While working on a recent project, I had to build a feature that displayed a list of files available in a directory. A simple way is just to use scandir() and a foreach loop to spit out a pretty list. There's a small problem though: long lists aren't all that user friendly. I decided instead to paginate the results. Here's one way to do it using PHP 5.
</blockquote>
<p>
Her method reads in all of the (valid) files from the directory, assigns them to an array and uses the <a href="http://php.net/array_chunk">array_chunk</a> function to split them up into groups on five. These groups can be easily looped through and displayed out as links easily.
</p>]]></description>
      <pubDate>Mon, 15 Dec 2008 08:48:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPro.org: SPL Autoload]]></title>
      <guid>http://www.phpdeveloper.org/news/11408</guid>
      <link>http://www.phpdeveloper.org/news/11408</link>
      <description><![CDATA[<p>
On the PHPro.org website, <i>Kevin Waterson</i> has <a href="http://www.phpro.org/tutorials/SPL-Autoload.html">written up an introduction</a> to the handy autoloading functionality that comes with PHP5 releases - the __autoload method from the Standard PHP Library (SPL).
</p>
<blockquote>
The SPL __autoload() method is one of the Magic Methods supplied in PHP. The __autoload method is called whenever a class is instantiated and will load the classs the the first time it is called. No longer is include(), require, include_once() or require_once needed as the SPL autoload takes care of this interally. 
</blockquote>
<p>
He looks at how you can use it to load a directory of classes, how to use multiple autoloads in a single script and how to use it with interfaces to register a loader and include it as needed.
</p>]]></description>
      <pubDate>Fri, 14 Nov 2008 09:31:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NETTUTS.com: Scanning Folders with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11403</guid>
      <link>http://www.phpdeveloper.org/news/11403</link>
      <description><![CDATA[<p>
The NETTUTS.com site has posted <a href="http://nettuts.com/videos/screencasts/scanning-folders-with-php/">a new PHP-related screencast</a> that covers a simple script to scan over the contents of folders in PHP. To illustrate, they create an image gallery script that mirrors the filesystem structure.
</p>
<blockquote>
Let's imagine that you want to build a page that will display snapshots of your latest work. [...] In such instances, the best solution is to make PHP scan your "portfolio" folder and dynamically create the code for you. If you want to update your page with a new snapshot, all that you need to do is drag the image, and its respective thumbnail, into the appropriate folders - and PHP will do the rest. Let's build it now! 
</blockquote>
<p>
The screencast comes complete with <a href="http://nettuts.s3.amazonaws.com/120_screencast/scanFolders.zip">the entire source</a> and a <a href="http://nettuts.com/demos/018_screencast/featured.php">link to a demo</a> to show the end result.
</p>]]></description>
      <pubDate>Thu, 13 Nov 2008 14:18:28 -0600</pubDate>
    </item>
  </channel>
</rss>
