11 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
4da854a68b MDL-54677 upgrade: add 3.1.0 separation line to all upgrade scripts 2016-05-23 01:31:34 +02:00
Eloy Lafuente (stronk7)
1abca11e0a MDL-54638 versions: bump all versions and requires near release
version = 2016052300 release version
requires= 2016051900 current rc1 version
2016-05-19 02:16:15 +02:00
Ruslan Kabalin
71f74dd165 MDL-50887 antivirus_clamav: Add unit tests for scanner class.
We are using "stubbing" method to replace real component (clamav) control
points with doubles in order to avoid direct calls to clamav. For more
details, please refer to https://phpunit.de/manual/4.8/en/test-doubles.html

Notice, that while it is possible to use setExpectedException in the tests,
this does not seem play correctly with consecutive assertions in the same
test after exception is thrown (they seem omitted). Explicit try/catch
construction has been used in testing instead.

To run just this test, use:
vendor/bin/phpunit antivirus_clamav_scanner_testcase lib/antivirus/clamav/tests/scanner_test.php
2016-02-29 09:31:30 +00:00
Ruslan Kabalin
d08667a271 MDL-50887 antivirus_clamav: Access config properties using getter. 2016-02-29 09:31:29 +00:00
Ruslan Kabalin
5b6a0f2c15 MDL-50887 antivirus_clamav: Split scanning logic and results processing.
This refactoring will make possible to assert scan results processing
behaviour in unit testing.
2016-02-29 09:31:29 +00:00
Ruslan Kabalin
b6bb4e81bb MDL-50887 antivirus: Use autoloaded classes.
This implements the use of class autoloading for antivirus plugin. Base
abstract class, exception class and manager are using namespace
core\antivirus, this is because all three class files are located in
/lib/classes/antivirus/ (see \core_component::classloader for convention
details).
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
1a980fdadb MDL-50887 antivirus: Fix style issues. 2016-02-25 09:55:45 +00:00
Ruslan Kabalin
001feb6649 MDL-50887 antivirus: Refactor antivirus scanning to use new plugin.
This patch moves existing scanning functionality to plugin level. It does
not add anything new, just refactors the existing functionality.

AMOS BEGIN
  MOV [clamemailsubject,core],[emailsubject,antivirus]
  MOV [clamfailed,core],[clamfailed,antivirus_clamav]
  MOV [clamlost,core],[invalidpathtoclam,antivirus_clamav]
  MOV [clamunknownerror,core],[unknownerror,antivirus_clamav]
  MOV [virusfounduser,core],[virusfounduser,antivirus]
AMOS END
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
1a1d249a70 MDL-50887 antivirus_clamav: Implement file scanning functionality.
This also removes runclamonupload config setting. It is implied that files
will be scanned if plugin is enabled, no need to have a separate setting.

In addition to that, some language strings are updated. It is 'ClamAV', not
'clam AV' (see http://www.clamav.net/index.html).
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
7d19e0e33d MDL-50887 antivirus_clamav: Move global clamav settings to plugin level.
AMOS BEGIN
 MOV [clamfailureonupload,core],[clamfailureonupload,antivirus_clamav]
 MOV [configclamactlikevirus,core],[configclamactlikevirus,antivirus_clamav]
 MOV [configclamdonothing,core],[configclamdonothing,antivirus_clamav]
 MOV [configclamfailureonupload,core],[configclamfailureonupload,antivirus_clamav]
 MOV [configpathtoclam,core],[configpathtoclam,antivirus_clamav]
 MOV [configquarantinedir,core],[configquarantinedir,antivirus_clamav]
 MOV [configrunclamavonupload,core],[configrunclamavonupload,antivirus_clamav]
 MOV [pathtoclam,core],[pathtoclam,antivirus_clamav]
 MOV [quarantinedir,core],[quarantinedir,antivirus_clamav]
 MOV [runclamavonupload,core],[runclamavonupload,antivirus_clamav]
AMOS END
2016-02-25 09:55:45 +00:00
Ruslan Kabalin
89a5878e3f MDL-50887 antivirus_clamav: Initial commit. 2016-02-25 09:54:05 +00:00