Skip to content

Commit

Permalink
FEATURE: Allow overriding the LockHoldingPage via environment variable
Browse files Browse the repository at this point in the history
You can now specify the environment variable FLOW_LOCKHOLDINGPAGE in order
to override the path to the page shown, when the site is locked, relative
to the FLOW_ROOT_PATH.

Resolves #585
  • Loading branch information
albe committed Aug 29, 2018
1 parent 9e07e93 commit a099885
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Neos.Flow/Classes/Core/LockManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public function __construct()
$lockPath = $this->getLockPath();
$this->lockPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_Flow.lock';
$this->lockFlagPathAndFilename = $lockPath . md5(FLOW_PATH_ROOT) . '_FlowIsLocked';
$this->lockHoldingPage = defined('FLOW_LOCKHOLDINGPAGE') ? FLOW_PATH_ROOT . FLOW_LOCKHOLDINGPAGE : FLOW_PATH_FLOW . 'Resources/Private/Core/LockHoldingStackPage.html';
$this->removeExpiredLock();
}

Expand Down Expand Up @@ -146,7 +147,7 @@ protected function doExit()
{
if (FLOW_SAPITYPE === 'Web') {
header('HTTP/1.1 503 Service Temporarily Unavailable');
readfile(FLOW_PATH_FLOW . 'Resources/Private/Core/LockHoldingStackPage.html');
readfile($this->lockHoldingPage);
} else {
$expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));
echo 'Site is currently locked, exiting.' . PHP_EOL . 'The current lock will expire after ' . $expiresIn . ' seconds.' . PHP_EOL;
Expand Down

0 comments on commit a099885

Please sign in to comment.