示例#1
0
 public function test_manager_get_antivirus()
 {
     // We are using clamav plugin in the test,
     // as the only plugin we know exists for sure.
     $antivirusviaget = \core\antivirus\manager::get_antivirus('clamav');
     $antivirusdirect = new \antivirus_clamav\scanner();
     $this->assertEquals($antivirusdirect, $antivirusviaget);
 }
示例#2
0
/**
 * Returns the string equivalent of a numeric clam error code
 *
 * @deprecated since Moodle 3.0 - this is a part of clamav plugin now.
 * @param int $returncode The numeric error code in question.
 * @return string The definition of the error code
 */
function get_clam_error_code($returncode)
{
    debugging('get_clam_error_code() is deprecated, please use get_clam_error_code() method of \\antivirus_clamav\\scanner class.', DEBUG_DEVELOPER);
    $antivirus = \core\antivirus\manager::get_antivirus('clamav');
    return $antivirus->get_clam_error_code($returncode);
}