made the maintenance marking file configurable and changed its default to be visible
This commit is contained in:
parent
61a604567d
commit
6b96468349
3 changed files with 23 additions and 16 deletions
21
Classes/DistributionFileMaintenanceModeManager.php
Normal file
21
Classes/DistributionFileMaintenanceModeManager.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,3 +6,5 @@ DigiComp:
|
||||||
allowModules:
|
allowModules:
|
||||||
DigiComp.FlowMaintenance:AllowByCookieModule:
|
DigiComp.FlowMaintenance:AllowByCookieModule:
|
||||||
position: start
|
position: start
|
||||||
|
maintenanceManager:
|
||||||
|
pathToCheck: "%FLOW_PATH_ROOT%/MAINTENANCE"
|
||||||
|
|
Loading…
Add table
Reference in a new issue