This commit is contained in:
Victor Dubiniuk 2014-09-09 22:45:54 +03:00
Родитель 353f32e4e5
Коммит ed9814ea5f
1 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -29,11 +29,14 @@ OCP\BackgroundJob::AddRegularTask('OCA\Files_Antivirus\BackgroundScanner', 'chec
$avBinary = \OCP\Config::getAppValue('files_antivirus', 'av_path', '');
if (empty($avBinary)){
\OCP\Config::setAppValue('files_antivirus', 'av_path', '/usr/bin/clamscan');
$query = \OCP\DB::prepare('SELECT count(`id`) AS `totalRules` FROM `*PREFIX*files_antivirus_status`');
$result = $query->execute();
$result = $result->fetchRow();
if($result['totalRules'] == 0) {
\OCA\Files_Antivirus\Status::init();
try {
$query = \OCP\DB::prepare('SELECT count(`id`) AS `totalRules` FROM `*PREFIX*files_antivirus_status`');
$result = $query->execute();
$result = $result->fetchRow();
if($result['totalRules'] == 0) {
\OCA\Files_Antivirus\Status::init();
}
\OCP\Config::setAppValue('files_antivirus', 'av_path', '/usr/bin/clamscan');
} catch (\Exception $e) {
}
}