pfpFileTree: Manipulates files in directories recursively

Recommend this page to a friend!
  Info   View files (9)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 455 All time: 6,029 This week: 327
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
Age: ???
All time rank: 146964 in United Kingdom
Week rank: 762 23 in United Kingdom
Innovation award
Innovation award
Nominee: 3x

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.
File Role Description Class the class
example0.php Example example
example1.php Example example
example2.php Example example
example3.php Example example
example4.php Example example
example5.php Example example
pfpFileTreeDoc.html Doc. Documentation
README Doc. description

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:6,029
This week:327

For more information send a message to info at phpclasses dot org.