PHP Classes

PHP File Change Scanner: Scan directories to detect modified files

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 304 All time: 7,357 This week: 129Up
Version License PHP version Categories
file-change-scanner 0.1BSD License4.0Files and Folders, Security


This class can scan directories to detect modified files.

It can traverse given directories recursively to retrieve the list of files and their last modification dates and content hashes.

The class queries a MySQL database table to check if each of the found file is already in the scanned database table.

It will insert table records for each new file that is found.

If any files that were already recorded had the hash value changed, the class will send a notification to a given email address to notify file changes.

The class may exclude certain directories and files from the scan process.

Picture of Dmitry Stroganov
  Performance   Level  
Name: Dmitry Stroganov <contact>
Classes: 2 packages by
Country: Russian Federation Russian Federation
Age: 43
All time rank: 3651102 in Russian Federation Russian Federation
Week rank: 703 Up27 in Russian Federation Russian Federation Up

File scanner. File scanner class is created to scan modified files and notify user about the modifications. If you are not sure about CMS/your sites protection against the hackers you can get notifications about file modifications and decide if these modifications are ok or your site is hacked and it is time to change CMS/fix the site code. It is a simple alternative to OSSEC. How to use: 1. Create mysql database and table using create_db.sql script; 2. Define paths that you wish to be scanned in class constructor; 3. Define exceptions in class constructor; 4. Define email address to send notifications to in class constructor; 5. Define timezone in class constructor; 6. Define mysql information in class constructor; 7. Put the script into a directory and protect the directory with .htaccess if it is available from the web; 8. Put scanner.php on cron with desired time period; 9. Enjoy the reports!
  Files folder image Files  
File Role Description
Accessible without login Plain text file create_db.sql Data Script to create mysql db and table
Accessible without login Plain text file readme.txt Doc. Readme file
Plain text file scanner.php Class Main class

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:7,357
This week:129Up