11 require_once
"./Services/VirusScanner/classes/class.ilVirusScanner.php";
24 parent::__construct($a_scancommand, $a_cleancommand);
25 $this->type =
"clamav";
26 $this->scanZipFiles =
true;
34 return $this->scanCommand .
' ' . self::ADD_SCAN_PARAMS .
' ' .
$file;
42 $functions =
array(
'proc_open',
'proc_close');
44 foreach ($functions as $func) {
45 if (function_exists($func)) {
74 $descriptorspec =
array(
75 0 =>
array(
"pipe",
"r"),
76 1 =>
array(
"pipe",
"w"),
77 2 =>
array(
"pipe",
"w")
86 if (!is_resource($process)) {
90 fwrite($pipes[0], $buffer);
93 $detectionReport = stream_get_contents($pipes[1]);
96 $errorReport = stream_get_contents($pipes[2]);
99 $return = proc_close($process);
110 return preg_match(
"/FOUND/", $detectionReport);
120 public function scanFile($a_filepath, $a_origname =
"")
132 $this->scanFilePath = $a_filepath;
133 $this->scanFileOrigName = $a_origname;
138 $this->scanResult = implode(
"\n",
$out);
142 $this->scanFileIsInfected =
true;
146 $this->scanFileIsInfected =
false;
151 $this->log->write(
"ERROR (Virus Scanner failed): " 153 .
"; COMMAMD=" . $cmd);
hasDetections($detectionReport)
logScanResult()
write the result of the last scan to the log public
__construct($a_scancommand, $a_cleancommand)
Constructor public.
scanFile($a_filepath, $a_origname="")
scan a file for viruses
scanFileFromBuffer($buffer)
Interface to the ClamAV virus protector.
Create styles array
The data for the language used.
Base class for the interface to an external virus scanner This class is abstract and needs to be exte...
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
buildScanCommand($file='-')
processBufferScan($buffer)