PHP Classes

PHP File Change Scanner: Scan directories to detect modified files

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 312 All time: 7,302 This week: 64Up
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: 45
All time rank: 3651103 in Russian Federation Russian Federation
Week rank: 214 Up15 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 (3)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:312
This week:0
All time:7,302
This week:64Up