Public Member Functions | |
ilVirusScannerAntivir ($a_scancommand, $a_cleancommand) | |
Constructor public. | |
scanFile ($a_filepath, $a_origname="") | |
scan a file for viruses |
Definition at line 37 of file class.ilVirusScannerAntiVir.php.
ilVirusScannerAntiVir::ilVirusScannerAntivir | ( | $ | a_scancommand, | |
$ | a_cleancommand | |||
) |
Constructor public.
string | virus scanner command |
Definition at line 44 of file class.ilVirusScannerAntiVir.php.
References ilVirusScanner::ilVirusScanner().
{ $this->ilVirusScanner($a_scancommand, $a_cleancommand); $this->type = "antivir"; $this->scanZipFiles = true; }
ilVirusScannerAntiVir::scanFile | ( | $ | a_filepath, | |
$ | a_origname = "" | |||
) |
scan a file for viruses
string | path of file to check | |
string | original name of the file to ckeck |
Reimplemented from ilVirusScanner.
Definition at line 59 of file class.ilVirusScannerAntiVir.php.
References $cmd, and ilVirusScanner::logScanResult().
{ // This function should: // - call the external scanner for a_filepath // - set scanFilePath to a_filepath // - set scanFileOrigName to a_origname // - set scanFileIsInfected according the scan result // - set scanResult to the scanner output message // - call logScanResult() if file is infected // - return the scanResult, if file is infected // - return an empty string, if file is not infected $this->scanFilePath = $a_filepath; $this->scanFileOrigName = $a_origname; // Call of antivir command $cmd = $this->scanCommand . " " . $a_filepath. " 2>&1"; exec($cmd, $out, $ret); $this->scanResult = implode("\n", $out); // sophie could be called if (ereg("ALERT:", $this->scanResult)) { $this->scanFileIsInfected = true; $this->logScanResult(); return $this->scanResult; } else { $this->scanFileIsInfected = false; return ""; } // antivir has failed (todo) $this->log->write("ERROR (Virus Scanner failed): " . $this->scanResult . "; COMMAMD=" . $cmd); }