-
Notifications
You must be signed in to change notification settings - Fork 0
/
GdataAntivirusPlugin.php
47 lines (42 loc) · 2.24 KB
/
GdataAntivirusPlugin.php
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
<?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;
});
$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();
}
}
}