Skip to content

Commit 1535fba

Browse files
committed
feat: add PublicFilesystemChecker
1 parent d5b8ada commit 1535fba

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Frosh\Tools\Components\Health\Checker\PerformanceChecker;
4+
5+
use Frosh\Tools\Components\Health\Checker\CheckerInterface;
6+
use Frosh\Tools\Components\Health\HealthCollection;
7+
use Frosh\Tools\Components\Health\SettingsResult;
8+
9+
class PublicFilesystemChecker implements CheckerInterface
10+
{
11+
private string $fileSystemType;
12+
13+
public function __construct(string $fileSystemType)
14+
{
15+
$this->fileSystemType = $fileSystemType;
16+
}
17+
18+
public function collect(HealthCollection $collection): void
19+
{
20+
$url = 'https://developer.shopware.com/docs/guides/hosting/infrastructure/filesystem#integrated-adapter-configurations';
21+
if ($this->fileSystemType !== 'local') {
22+
$collection->add(
23+
SettingsResult::ok('frosh-tools.checker.publicFilesystemGood',
24+
$this->fileSystemType,
25+
'not local',
26+
$url
27+
)
28+
);
29+
30+
return;
31+
}
32+
33+
$collection->add(
34+
SettingsResult::warning('frosh-tools.checker.publicFilesystemBad',
35+
$this->fileSystemType,
36+
'not local',
37+
$url
38+
)
39+
);
40+
}
41+
}

src/Resources/config/services.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@
109109
<tag name="frosh_tools.performance_checker"/>
110110
</service>
111111

112+
<service id="Frosh\Tools\Components\Health\Checker\PerformanceChecker\PublicFilesystemChecker">
113+
<argument>%shopware.filesystem.public.type%</argument>
114+
<tag name="frosh_tools.performance_checker"/>
115+
</service>
116+
112117
<service id="Frosh\Tools\Components\Health\Checker\PerformanceChecker\EsChecker">
113118
<argument type="service" id="Frosh\Tools\Components\Elasticsearch\ElasticsearchManager"/>
114119
<tag name="frosh_tools.performance_checker"/>

0 commit comments

Comments
 (0)