update
This commit is contained in:
22
modules/securitywatcher/cron_check.php
Normal file
22
modules/securitywatcher/cron_check.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Security Watcher - Cron file check
|
||||
* Run via cron every 15 minutes:
|
||||
* *\/15 * * * * php /path/to/prestashop/modules/securitywatcher/cron_check.php
|
||||
*/
|
||||
|
||||
// Bootstrap PrestaShop
|
||||
$dir = dirname(__FILE__);
|
||||
$psRoot = realpath($dir . '/../../');
|
||||
|
||||
require_once $psRoot . '/config/config.inc.php';
|
||||
|
||||
$module = Module::getInstanceByName('securitywatcher');
|
||||
|
||||
if ($module && $module->active) {
|
||||
$changes = $module->cronCheckFiles();
|
||||
$total = count($changes['new']) + count($changes['modified']) + count($changes['deleted']);
|
||||
echo date('Y-m-d H:i:s') . " - Check complete. Changes: {$total}\n";
|
||||
} else {
|
||||
echo "SecurityWatcher module not active.\n";
|
||||
}
|
||||
Reference in New Issue
Block a user