19 declare(strict_types=1);
    25     public function __construct(
string $scan_command, 
string $clean_command)
    28         $this->scanCommand = IL_ICAP_CLIENT;
    33         return ' -i ' . IL_ICAP_HOST . 
' -p ' . IL_ICAP_PORT . 
' -v -s ' . IL_ICAP_AV_COMMAND . 
' -f ' . $file;
    36     public function scanFile(
string $file_path, 
string $org_name = 
""): string
    39         if (file_exists($file_path)) {
    40             if (is_readable($file_path)) {
    41                 $file_path = realpath($file_path);
    46                 $timeout = preg_grep(
'/failed\/timedout.*/', 
$out);
    47                 $virus_detected = preg_grep(
'/' . self::HEADER_INFECTION_FOUND . 
'.*/', 
$out);
    48                 if (is_array($virus_detected) && count($virus_detected) > 0) {
    49                     $return_string = sprintf(
'Virus detected in %s', $file_path);
    50                     $this->log->warning($return_string);
    52                 } elseif (is_array($timeout) && count($timeout) > 0) {
    53                     $return_string = 
'Cannot connect to icap server.';
    54                     $this->log->warning($return_string);
    56                 $this->scanResult = implode(
"\n", 
$out);
    58                 $return_string = sprintf(
'File "%s" not readable.', $file_path);
    59                 $this->log->info($return_string);
    62             $return_string = sprintf(
'File "%s" not found.', $file_path);
    63             $this->log->info($return_string);
    66         $this->log->info(sprintf(
'No virus found in file "%s".', $file_path));
    68         return $return_string;
 const HEADER_INFECTION_FOUND
 
buildScanCommandArguments(string $file='-')
 
static escapeShellArg(string $a_arg)
 
__construct(string $scan_command, string $clean_command)
 
scanFile(string $file_path, string $org_name="")
 
static execQuoted(string $cmd, ?string $args=null)
 
static escapeShellCmd(string $a_arg)
 
__construct(Container $dic, ilPlugin $plugin)