PHP Classes

PHP Path Difference: Analyze directories and find new or changed files

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 133 All time: 9,216 This week: 263Up
Version License PHP version Categories
analyze-path-differe 1.0.0GNU General Publi...5PHP 5, Files and Folders
Description Author

This class can analyze directories and find new or changed files.

It can traverse a given directory to find the paths of all files.

The class can compute a hash of all files and saves the information in all files.

Later it can compare the hashes of all files to any previous snapshot stored in a database to find which files were added, changed or deleted. This process can be repeated regularly.

Picture of John Rutherford
Name: John Rutherford <contact>
Classes: 1 package by
Country: Thailand Thailand
Age: 77
All time rank: 427412 in Thailand Thailand
Week rank: 587 Up1 in Thailand Thailand Up


Analyze Path Differences


Have you ever wondered what files have been newly created, last modified or even deleted?

Look no further - this is the App' for that :)

Snapshot Class

  • A simple Class that interrogates all files in a site path.
  • File contents are hashed and a "snapshot" saved to a dynamically created database table.
  • Unfortunately folder names must be "fixed" to in order to conform :)
  • Any time afterwards the "snapshot" can be compared against the current files.
  • All discrepancies are shown which facilitates finding problematic files.
  • A new "snapshot" can be created once all discrepances have been resolved.

Analysis Path Difference Results:

* Amended files
* Deleted files
* New files


1. Download and extract any of the following zip files into a new LOCALHOST "folder-name":
2. source.tar.xz source.7z
3. Use PhpMyAdmin to create a "DB_HOST" Database named "DB_NAME"
4. Set Database permissions for:
    * "DB_USER"
    * "DB_PWD"
5. Edit:   _config.php
    * Set Database values for: DB_HOST, DB_USER, DB_PWD, DB_NAME
    More paths may be added to the "folder-name" path and its parent*
    * Browse to "folder-name"/index.php
    * Test thoroughly and once satisfied upload to your online site.

Online Demo

Screen Shot

  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file interrogator.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file Doc. Documentation
Plain text file _class-snapshot.php Class Class source
Accessible without login Plain text file _config.php Aux. Auxiliary script
Accessible without login Plain text file _style.css Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,216
This week:263Up