News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weir O'Phinney's Blog:
File_Fortune refactored
July 06, 2007 @ 09:36:00

In a new blog entry today, Matthew Weir O'Phinney talks about updates (and refactoring) that he's done to a PEAR package he's developed, File_Fortune.

Over the past few evenings, I've refactored File_Fortune to have it implement Iterator, Countable, and ArrayAccess -- basically allowing it to act like an array for most intents and purposes. As a result, I've eliminated the need for the File_Fortune_Writer package, and greatly simplified the usage.

The package is designed to make an interface between the casual PHP user and the fortune files common on most *nix machines. To illustrate he update, he includes some code that grabs the fortune file, parses it to grab a random one and echoes them out. Also included is the save() method so you can add your own to the list easily.

0 comments voice your opinion now!
filefortune refactor pear package fortune filefortune refactor pear package fortune


blog comments powered by Disqus

Similar Posts

Joshua Eichorn\'s Blog: HTML_AJAX 0.3.1 Released

Stuart Herbert's Blog: Installing Phix on Various OSes (OSX, Debian, Ubuntu, Fedora)

Justin Silverton\'s Blog: The Zend Framework

Sebastian Bergmann's Blog: So Long, and Thanks for all the PEARs

Secunia.com: rPath Update for Multiple php Packages


Community Events





Don't see your event here?
Let us know!


opinion series testing podcast list install framework unittest laravel release refactor interview language community code experience introduction symfony2 threedevsandamaybe developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework