require_once "include/functions_inc.php"; require_once "class/Entity_abstract.php"; $logto = "std"; if (!$_REQUEST['file']) { $_REQUEST['file'] = $argv[1]; $logto = $argv[2]; } if ($CONF['logging'] == true) { require_once "class/Logfile_class.php"; $log = new Logfile($CONF['logfile'], $logto); } $log->logf("File: '" . $_REQUEST['file'] . "'"); #$log->logf("Starting up... ",false); if (!$_REQUEST['file']) { $log->logf("ERROR: no file given! EXITING!"); $log->close(); die; } //create database connection $DBc = new mySQL($CONF['mysql_error']); $DBc->connect($CONF['mysql_server'], $CONF['mysql_user'], $CONF['mysql_pass'], $CONF['mysql_database']); require_once "class/DataDispatcher_class.php"; require_once "class/DataSourceHandler_class.php"; require_once "class/SourceDriver_abstract.php"; require_once "class/Callback_class.php"; require_once "class/ValueCache_class.php"; require_once "class/Atom_class.php"; require_once "class/XMLgenerator_class.php"; require_once "class/XMLnode_class.php"; require_once "class/XMLfile_class.php"; require_once "class/Stats_class.php";
if ($scan->Connect()) { // check to see if last scan completed correctly if ($alreadyRunning === false) { $scan->scanFiles($path, $skipFolders, $processExtensions, $skipExtensions); } set_time_limit(30); $scan->emailResults($email, $emailinterval, $alreadyRunning); $scan->deleteOldTestedRecords(); $scan = NULL; } else { $text = "Error in running hashscan.php for this domain, consult logfile"; $mailed = mail($email, "WebMonitor: ERROR SCANNING " . $domain, $text); } unset($appStatus); Logfile::writeWhen("Closing Logfile"); Logfile::close(); function formatDateDiff($interval) { $doPlural = function ($nb, $str) { return $nb > 1 ? $str . 's' : $str; }; // adds plurals $format = array(); if ($interval->y !== 0) { $format[] = "%y " . $doPlural($interval->y, "year"); } if ($interval->m !== 0) { $format[] = "%m " . $doPlural($interval->m, "month"); } if ($interval->d !== 0) { $format[] = "%d " . $doPlural($interval->d, "day");