You are here

function clamav_get_version in ClamAV 7

Same name and namespace in other branches
  1. 6 clamav.inc \clamav_get_version()

Get the version information for clamav.

Parameters

Mixed $settings For executable:: String: path to the clamscan executable For daemon: Array: providing the keys 'host' and 'port'

Return value

String The version string, as provided by clamav.

1 call to clamav_get_version()
clamav_requirements in ./clamav.install
Implements hook_requirements().

File

./clamav.inc, line 350
clamav.inc API and helper functions for the ClamAV module.

Code

function clamav_get_version($settings) {
  if (is_string($settings) && !empty($settings)) {
    return _clamav_get_version_via_exec($settings);
  }
  elseif (is_array($settings) && isset($settings['host']) && isset($settings['port'])) {
    return _clamav_get_version_via_daemon($settings['host'], $settings['port']);
  }
  elseif (is_array($settings) && isset($settings['unix_socket_path'])) {
    $socket = "unix://{$settings['unix_socket_path']}";
    return _clamav_get_version_via_daemon($socket, NULL);
  }
}