PHP Classes
elePHPant
Icontem

pfpFileTree: Manipulates files in directories recursively

Recommend this page to a friend!
  Info   View files View files (9)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2011-03-18 (5 years ago) RSS 2.0 feedNot enough user ratingsTotal: 450 This week: 1All time: 5,865 This week: 1,047Up
Version License PHP version Categories
pfp-file-tree 1.0BSD License5.0PHP 5, Files and Folders
Description Author

This class can manipulates files in directories recursively.

It can traverse a given directory recursively and match files that satisfy given filter conditions based on the file names, size, modification time, permissions, etc..

The class may call given callback functions to perform custom operations on the matched files defined by the applications.

Innovation Award
PHP Programming Innovation award nominee
April 2011
Number 7
Sometimes it is necessary to execute a custom processing job on a large number of files contained in directory and eventually in its sub-directories.

This class makes it easier to achieve that by traversing a given directory recursively. For each file that matches a given pattern it calls a user-defined callback function that you can use to perform your custom processing job.

Manuel Lemos
Picture of Colin McKinnon
  Performance   Level  
Name: Colin McKinnon <contact>
Classes: 4 packages by
Country: United Kingdom United Kingdom
Innovation award
Innovation award
Nominee: 3x

Details
pfpFileTree is intended to be a Swiss Army knife for dealing with trees of files.

The API was inspired by jQuery and allows you to select a subset of the files
which exist within tree on the basis of various parameters such as name, size,
modificaton time etc.

In addition to adding functionality by overriding the class, you can apply
callbacks to lists of files to perform operations on the files and/or 
capture attributes relating to the files.

It is not strongly tied to the Unix permissions model - indeed, internally
it only works out which files/dirs are readable/writeable. Of course adding
support for various permissions systems is straightforward. And you can even
use it as a tool for managing permissions.

Please note that PHP does not support the sophisticated type of file lock
management required for supporting multi-user concurrent access to data 
stored in files. This tool is not intended as a substitute for a transaction
processing database.

Documentation can be found in the manual.
  Files folder image Files  
File Role Description
Accessible without login Plain text file pfpFileTree.inc.php Class the class
Accessible without login Plain text file example0.php Example example
Accessible without login Plain text file example1.php Example example
Accessible without login Plain text file example2.php Example example
Accessible without login Plain text file example3.php Example example
Accessible without login Plain text file example4.php Example example
Accessible without login Plain text file example5.php Example example
Accessible without login HTML file pfpFileTreeDoc.html Doc. Documentation
Accessible without login Plain text file README Doc. description

 Version Control Unique User Downloads Download Rankings  
 0%
Total:450
This week:1
All time:5,865
This week:1,047Up