made the maintenance marking file configurable and changed its default to be visible

This commit is contained in:
Ferdinand Kuhl 2024-12-10 17:33:39 +01:00
parent 61a604567d
commit 6b96468349
3 changed files with 23 additions and 16 deletions

View file

@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
namespace DigiComp\FlowMaintenanceMode;
use Neos\Flow\Annotations as Flow;
class DistributionFileMaintenanceModeManager implements MaintenanceModeManagerInterface
{
#[Flow\InjectConfiguration(path: 'maintenanceManager.pathToCheck')]
protected string $pathToCheck;
public function isMaintenanceMode(): bool
{
if (\file_exists($this->pathToCheck)) {
return true;
}
return false;
}
}

View file

@ -1,16 +0,0 @@
<?php
declare(strict_types=1);
namespace DigiComp\FlowMaintenanceMode;
class MaintenanceModeDistributionFileManager implements MaintenanceModeManagerInterface
{
public function isMaintenanceMode(): bool
{
if (\file_exists(\FLOW_PATH_ROOT . '/.maintenance')) {
return true;
}
return false;
}
}

View file

@ -6,3 +6,5 @@ DigiComp:
allowModules:
DigiComp.FlowMaintenance:AllowByCookieModule:
position: start
maintenanceManager:
pathToCheck: "%FLOW_PATH_ROOT%/MAINTENANCE"