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: 309 This week: 2All time: 7,327 This week: 96Up
Version License PHP version Categories
file-change-scanner 0.1BSD License4.0Files and Folders, Security
Description 

Author

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: 44
All time rank: 3652103 in Russian Federation Russian Federation
Week rank: 106 Up7 in Russian Federation Russian Federation Up

Documentation

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  
 0%
Total:309
This week:2
All time:7,327
This week:96Up