PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2018-01-28 (15 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 3 This week: 3All time: 9,154 This week: 225Up
Version License PHP version Categories
analyze-path-differe 1.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.

Name: John Rutherford <contact>
Classes: 1 package by
Country: Thailand Thailand

Details

Analyze Path Differences

Introduction:

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

Installation:

1. Download and extract any of the following zip files into a new LOCALHOST "folder-name":
2. source.zip 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 README.md 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  
 100%
Total:3
This week:3
All time:9,154
This week:225Up