This repository was archived by the owner on Mar 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGdataAntivirusPlugin.php
More file actions
52 lines (47 loc) · 2.27 KB
/
GdataAntivirusPlugin.php
File metadata and controls
52 lines (47 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace Gdatacyberdefenseag\GdataAntivirus;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\Database\FindingsQuery;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\Database\IFindingsQuery;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\Database\IScansQuery;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\Database\ScansQuery;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\FileSystem\IGdataAntivirusFileSystem;
use Gdatacyberdefenseag\GdataAntivirus\Infrastructure\FileSystem\WordPressFileSystem;
use Gdatacyberdefenseag\GdataAntivirus\PluginPage\AdminNotices;
use Gdatacyberdefenseag\GdataAntivirus\PluginPage\Findings\FindingsMenuPage;
use Gdatacyberdefenseag\GdataAntivirus\PluginPage\FullScan\FullScanMenuPage;
use Gdatacyberdefenseag\GdataAntivirus\PluginPage\OnDemandScan\OnDemandScan;
use Gdatacyberdefenseag\GdataAntivirus\PluginPage\GdataAntivirusMenuPage;
use Gdatacyberdefenseag\GdataAntivirus\Vaas\ScanClient;
use Illuminate\Container\Container;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
if (! class_exists('GdataAntivirusPlugin')) {
class GdataAntivirusPlugin extends Container
{
public function __construct(LoggerInterface $logger = new NullLogger())
{
$logger->info('GdataAntivirusPlugin::__construct');
$this->singleton(FindingsMenuPage::class, FindingsMenuPage::class);
$this->singleton(FullScanMenuPage::class, FullScanMenuPage::class);
$this->singleton(OnDemandScan::class, OnDemandScan::class);
$this->singleton(IGdataAntivirusFileSystem::class, WordPressFileSystem::class);
$this->singleton(IFindingsQuery::class, FindingsQuery::class);
$this->singleton(IScansQuery::class, ScansQuery::class);
$this->singleton(GdataAntivirusMenuPage::class, GdataAntivirusMenuPage::class);
$this->singleton(ScanClient::class, ScanClient::class);
$this->singleton(AdminNotices::class, AdminNotices::class);
$this->singleton(LoggerInterface::class, function () use ($logger) {
return $logger;
});
}
public function start()
{
$this->make(GdataAntivirusMenuPage::class);
$findings_menu = $this->make(FindingsMenuPage::class);
$this->make(FullScanMenuPage::class);
$this->make(OnDemandScan::class);
assert($findings_menu instanceof FindingsMenuPage);
$findings_menu->validate_findings();
}
}
}