Skip to content

Commit 2bf89f4

Browse files
committed
Add support for CMS 6
1 parent fd6363e commit 2bf89f4

19 files changed

+589
-692
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ By running the task below, all files uploaded before installation of the module
9797
scanned.
9898
9999
```
100-
/dev/tasks/Symbiote-SteamedClams-ClamAVInstallTask
100+
./vendor/bin/sake tasks:clamav-install
101101
```
102102

103103
To ignore certain files before a specific date, you can configure the datetime in your `YML` files, as below:

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@
1313
}
1414
],
1515
"require": {
16-
"silverstripe/framework": "^5",
17-
"silverstripe/admin": "^2",
18-
"silverstripe/reports": "^5",
19-
"silverstripe/siteconfig": "^5",
20-
"xenolope/quahog": "^3.0"
16+
"php": "^8.3",
17+
"silverstripe/framework": "^6",
18+
"silverstripe/admin": "^3",
19+
"silverstripe/reports": "^6",
20+
"silverstripe/siteconfig": "^6",
21+
"xenolope/quahog": "^3.0",
22+
"silverstripe/asset-admin": "^3.0"
2123
},
2224
"require-dev": {
23-
"phpunit/phpunit": "^9.5"
25+
"phpunit/phpunit": "^11.5"
2426
},
2527
"suggest": {
2628
"silverstripe/queuedjobs": "For allowing ClamAV 'missed files' scan to be run from a queued job. Otherwise you can run the tasks manually or via cronjob."
2729
},
2830
"extra": {
2931
"branch-alias": {
30-
"dev-master": "4.0.x-dev"
32+
"dev-master": "5.0.x-dev"
3133
},
3234
"expose": [
3335
"client/css",

phpunit.xml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true">
3-
<coverage includeUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">src/</directory>
6-
</include>
7-
<exclude>
8-
<directory suffix=".php">tests/</directory>
9-
</exclude>
10-
</coverage>
11-
<testsuites>
1+
<?xml version="1.0"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/framework/tests/bootstrap.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd">
123
<testsuite name="Default">
13-
<directory>tests</directory>
4+
<directory>tests/</directory>
145
</testsuite>
15-
</testsuites>
6+
<source>
7+
<include>
8+
<directory suffix=".php">src/</directory>
9+
</include>
10+
<exclude>
11+
<directory suffix=".php">tests/</directory>
12+
</exclude>
13+
</source>
1614
</phpunit>

src/Admin/ClamAVAdmin.php

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Symbiote\SteamedClams\Admin;
44

55
use SilverStripe\Admin\ModelAdmin;
6+
use SilverStripe\AssetAdmin\Controller\AssetAdmin;
67
use SilverStripe\Control\Controller;
78
use SilverStripe\Control\HTTPResponse;
89
use SilverStripe\Core\Injector\Injector;
@@ -16,40 +17,23 @@
1617
use Symbiote\SteamedClams\ClamAV;
1718
use Symbiote\SteamedClams\Forms\GridFieldClamAVAction;
1819
use Symbiote\SteamedClams\Model\ClamAVScan;
19-
use SilverStripe\AssetAdmin\Controller\AssetAdmin;
2020

2121
/**
22-
* Class Symbiote\SteamedClams\ClamAVAdmin
23-
*
22+
* Class Symbiote\SteamedClams\ClamAVAdmin.
2423
*/
2524
class ClamAVAdmin extends ModelAdmin
2625
{
27-
/**
28-
* @var string
29-
*/
30-
private static $url_segment = 'clamav';
26+
private static string $url_segment = 'clamav';
3127

32-
/**
33-
* @var string
34-
*/
35-
private static $menu_title = 'ClamAV';
28+
private static string $menu_title = 'ClamAV';
3629

37-
/**
38-
* @var array
39-
*/
40-
private static $managed_models = [
30+
private static array $managed_models = [
4131
ClamAVScan::class,
4232
];
4333

44-
/**
45-
* @var string
46-
*/
47-
private static $menu_icon = 'symbiote/silverstripe-steamedclams:client/images/clamav_icon.png';
34+
private static string $menu_icon = 'symbiote/silverstripe-steamedclams:client/images/clamav_icon.png';
4835

49-
/**
50-
* @var array
51-
*/
52-
private static $allowed_actions = [
36+
private static array $allowed_actions = [
5337
'Assets',
5438
];
5539

@@ -72,7 +56,7 @@ public function Assets()
7256
}
7357
$assetAdmin->setCurrentPageID($id);
7458

75-
//Session::set($assetAdmin->class.".currentPage", (int)$id);
59+
// Session::set($assetAdmin->class.".currentPage", (int)$id);
7660
return $this->redirect(
7761
Controller::join_links($assetAdmin->Link('EditForm'), 'field', 'File', 'item', $id, 'edit')
7862
);
@@ -138,7 +122,7 @@ public function getEditForm($id = null, $fields = null)
138122
);
139123
}
140124

141-
//Files that failed to scan
125+
// Files that failed to scan
142126
$listCount = 0;
143127
$list = $clamAV->getFailedToScanFileList();
144128
if ($list) {

0 commit comments

Comments
 (0)