Login   Register  
PHP Classes
elePHPant
Icontem

Persistent Array: Access flat file databases like arrays

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2008-03-04 (6 years ago) RSS 2.0 feedNot enough user ratingsTotal: 839 All time: 3,818 This week: 1,547Up
Version License PHP version Categories  
parray 1.0BSD License5.0PHP 5, Databases, Data types
Description Author  

This class can be used to access flat file databases like arrays.

The class extends the SPL ArrayObject class to be able to retrieve, add, update and delete entries in flat file database files using the DBM extension.

It also provides an iterator class to be able to traverse the entries in a DBM file using the regular array access functions.

Innovation Award  
PHP Programming Innovation award nominee
March 2008
Number 6


Prize: One subscription to the PDF edition of the magazine by PHP Architect
Arrays are a very popular data type used in PHP to store a variable number of information items.

If you want to store information of arrays in a file or database so you can retrieve later, you can serialize the array and store it as a single data chunk.

However, that is not a very efficient solution. If the array is large, it may take too much time to store and retrieve changes or look up for elements.

This package takes advantage of the PHP 5 array iterator objects and implements a wrapper that stores and retrieve array elements in a flat file database managed by the DBM API.

This way the array can be stored persistently in files and its elements can be accessed very quickly.

Manuel Lemos
Picture of Cesar D. Rodas
Name: Cesar D. Rodas is available for providing paid consulting. Contact Cesar D. Rodas .
Classes: 37 packages by
Country: Paraguay Paraguay
Age: 27
All time rank: 71 in Paraguay Paraguay
Week rank: 26 Down1 in Paraguay Paraguay Equal
Innovation award
Innovation award
Nominee: 24x

Winner: 5x

  Files folder image Files  
File Role Description
Plain text file parray.php Class Main class
Accessible without login Plain text file test.php Test Testing

 Version Control Unique User Downloads Download Rankings  
 0%Total:839All time:3,818
 This week:0This week:1,547Up