13 require_once
"./Services/VirusScanner/classes/class.ilVirusScanner.php";
27 $this->type =
"clamav";
28 $this->scanZipFiles =
true;
36 return $this->scanCommand.
' '.self::ADD_SCAN_PARAMS.
' '.
$file;
44 $functions = array(
'proc_open',
'proc_close');
46 foreach($functions as $func)
48 if( function_exists($func) )
79 $descriptorspec = array(
80 0 => array(
"pipe",
"r"),
81 1 => array(
"pipe",
"w"),
82 2 => array(
"pipe",
"w")
91 if( !is_resource($process) )
96 fwrite($pipes[0], $buffer);
99 $detectionReport = stream_get_contents($pipes[1]);
102 $errorReport = stream_get_contents($pipes[2]);
105 $return = proc_close($process);
116 return preg_match(
"/FOUND/", $detectionReport);
139 $this->scanFilePath = $a_filepath;
140 $this->scanFileOrigName = $a_origname;
145 $this->scanResult = implode(
"\n",
$out);
150 $this->scanFileIsInfected =
true;
156 $this->scanFileIsInfected =
false;
161 $this->log->write(
"ERROR (Virus Scanner failed): " 163 .
"; COMMAMD=" .
$cmd);
hasDetections($detectionReport)
logScanResult()
write the result of the last scan to the log
scanFile($a_filepath, $a_origname="")
scan a file for viruses
scanFileFromBuffer($buffer)
ilVirusScannerClamAV($a_scancommand, $a_cleancommand)
Constructor public.
Interface to the ClamAV virus protector.
ilVirusScanner($a_scancommand, $a_cleancommand)
Constructor public.
Base class for the interface to an external virus scanner.
buildScanCommand($file='-')
processBufferScan($buffer)