ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilVirusScannerAntiVir Class Reference
+ Inheritance diagram for ilVirusScannerAntiVir:
+ Collaboration diagram for ilVirusScannerAntiVir:

Public Member Functions

 __construct (string $scan_command, string $clean_command)
 
 scanFile (string $file_path, string $org_name='')
 
- Public Member Functions inherited from ilVirusScanner
 __construct (string $scan_command, string $clean_command)
 
 scanBuffer (string $buffer)
 
 scanFile (string $file_path, string $org_name='')
 
 logScanResult ()
 
 cleanFile (string $file_path, string $org_name='')
 
 logCleanResult ()
 
 fileCleaned ()
 
 getScanResult ()
 
 getCleanResult ()
 
 getScanMessage ()
 
 getCleanMessage ()
 
 getScanZipFiles ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilVirusScanner
static virusHandling (string $a_file, string $a_orig_name='', bool $a_clean=true)
 
- Data Fields inherited from ilVirusScanner
string $type
 
bool $scanZipFiles
 
string $scanCommand
 
string $cleanCommand
 
string $scanFilePath
 
string $scanFileOrigName
 
string $cleanFilePath
 
string $cleanFileOrigName
 
bool $scanFileIsInfected
 
bool $cleanFileIsCleaned
 
string $scanResult
 
string $cleanResult
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilLogger $log
 
- Protected Member Functions inherited from ilVirusScanner
 scanFileFromBuffer (string $buffer)
 
 createBufferFile (string $buffer)
 
 removeBufferFile (string $bufferFile)
 

Detailed Description

Definition at line 21 of file class.ilVirusScannerAntiVir.php.

Constructor & Destructor Documentation

◆ __construct()

ilVirusScannerAntiVir::__construct ( string  $scan_command,
string  $clean_command 
)

Definition at line 23 of file class.ilVirusScannerAntiVir.php.

References ILIAS\GlobalScreen\Provider\__construct().

24  {
25  parent::__construct($scan_command, $clean_command);
26  $this->type = 'antivir';
27  $this->scanZipFiles = true;
28  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ scanFile()

ilVirusScannerAntiVir::scanFile ( string  $file_path,
string  $org_name = '' 
)

Definition at line 30 of file class.ilVirusScannerAntiVir.php.

References $out, ilVirusScanner\$scanResult, ilShellUtil\escapeShellArg(), ilShellUtil\escapeShellCmd(), ilShellUtil\execQuoted(), and ilVirusScanner\logScanResult().

30  : string
31  {
32  $this->scanFilePath = $file_path;
33  $this->scanFileOrigName = $org_name;
34 
35  // Call of antivir command
36  $a_filepath = realpath($file_path);
37  $cmd = ilShellUtil::escapeShellCmd($this->scanCommand);
38  $args = ilShellUtil::escapeShellArg(' ' . $a_filepath . ' ');
39  $out = ilShellUtil::execQuoted($cmd, $args);
40  $this->scanResult = implode("\n", $out);
41 
42  // sophie could be called
43  if (str_contains($this->scanResult, 'ALERT:')) {
44  $this->scanFileIsInfected = true;
45  $this->logScanResult();
46  return $this->scanResult;
47  }
48 
49  $this->scanFileIsInfected = false;
50  return '';
51  }
static escapeShellArg(string $a_arg)
$out
Definition: buildRTE.php:24
static execQuoted(string $cmd, ?string $args=null)
static escapeShellCmd(string $a_arg)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: