23 lines
668 B
PHP
23 lines
668 B
PHP
<?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";
|
|
}
|