mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°2240 - Supportability - Maintenance mode
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
define('APPROOT', dirname(__FILE__).'/');
|
||||
define('APPCONF', APPROOT.'conf/');
|
||||
define('ITOP_DEFAULT_ENV', 'production');
|
||||
define('MAINTENANCE_MODE_FILE', APPROOT.'data/.maintenance');
|
||||
|
||||
if (function_exists('microtime'))
|
||||
{
|
||||
@@ -23,7 +24,7 @@ if (!isset($bBypassMaintenance))
|
||||
$bBypassMaintenance = isset($_REQUEST['maintenance']) ? boolval($_REQUEST['maintenance']) : false;
|
||||
}
|
||||
|
||||
if (file_exists(APPROOT.'.maintenance') && !$bBypassMaintenance)
|
||||
if (file_exists(MAINTENANCE_MODE_FILE) && !$bBypassMaintenance)
|
||||
{
|
||||
$sMessage = 'Application is currently in maintenance';
|
||||
$sTitle = 'Maintenance';
|
||||
|
||||
@@ -1838,7 +1838,7 @@ EOF
|
||||
|
||||
public final static function EnterMaintenanceMode($oConfig)
|
||||
{
|
||||
@touch(APPROOT.'.maintenance');
|
||||
@touch(MAINTENANCE_MODE_FILE);
|
||||
SetupPage::log("----> Entering maintenance mode");
|
||||
try
|
||||
{
|
||||
@@ -1872,7 +1872,7 @@ EOF
|
||||
|
||||
public final static function ExitMaintenanceMode($bLog = true)
|
||||
{
|
||||
@unlink(APPROOT.'.maintenance');
|
||||
@unlink(MAINTENANCE_MODE_FILE);
|
||||
if ($bLog)
|
||||
{
|
||||
SetupPage::log("<---- Exiting maintenance mode");
|
||||
|
||||
@@ -306,7 +306,7 @@ function CronExec($oP, $aProcesses, $bVerbose)
|
||||
}
|
||||
sleep($iCronSleep);
|
||||
// Maintenance mode
|
||||
if (file_exists(APPROOT.'.maintenance'))
|
||||
if (file_exists(MAINTENANCE_MODE_FILE))
|
||||
{
|
||||
$oP->p("Maintenance mode detected");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user