Skip to content

Commit 6e2cf66

Browse files
committed
N°9327 Do not enter readonly or maintenance mode when doing data audit
1 parent ab691c3 commit 6e2cf66

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

setup/compiler.class.inc.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public static function SkipRebuildHKeys()
278278
* @return void
279279
* @throws Exception
280280
*/
281-
public function Compile($sTargetDir, $oP = null, $bUseSymbolicLinks = null, $bSkipTempDir = false)
281+
public function Compile($sTargetDir, $oP = null, $bUseSymbolicLinks = null, $bSkipTempDir = false, $bEnterMaintenanceMode = true)
282282
{
283283
if (is_null($bUseSymbolicLinks)) {
284284
$bUseSymbolicLinks = false;
@@ -297,8 +297,7 @@ public function Compile($sTargetDir, $oP = null, $bUseSymbolicLinks = null, $bSk
297297
} else {
298298
$oConfig = null;
299299
}
300-
if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) {
301-
300+
if (($this->sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) {
302301
SetupUtils::EnterMaintenanceMode($oConfig);
303302
}
304303
if ($bUseSymbolicLinks || $bSkipTempDir) {

setup/sequencers/ApplicationInstallSequencer.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,12 @@ protected function DoBackup($sBackupFileFormat, $sSourceConfigFile, $sMySQLBinDi
429429
*
430430
* @since 3.1.0 N°2013 added the aParamValues param
431431
*/
432-
protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bUseSymbolicLinks = null)
432+
protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bUseSymbolicLinks = null, $bEnterMaintenanceMode = true)
433433
{
434434
/**
435-
* @since 3.2.0 move the ContextTag init at the very beginning of the method
436-
* @noinspection PhpUnusedLocalVariableInspection
437-
*/
435+
* @since 3.2.0 move the ContextTag init at the very beginning of the method
436+
* @noinspection PhpUnusedLocalVariableInspection
437+
*/
438438
$oContextTag = new ContextTag(ContextTag::TAG_SETUP);
439439

440440
SetupLog::Info("Compiling data model.");
@@ -471,7 +471,7 @@ protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourc
471471

472472
$bIsAlreadyInMaintenanceMode = SetupUtils::IsInMaintenanceMode();
473473

474-
if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode) {
474+
if (($sEnvironment == 'production') && !$bIsAlreadyInMaintenanceMode && $bEnterMaintenanceMode) {
475475
$sConfigFilePath = utils::GetConfigFilePath($sEnvironment);
476476
if (is_file($sConfigFilePath)) {
477477
$oConfig = new Config($sConfigFilePath);
@@ -531,7 +531,7 @@ protected function DoCompile($aRemovedExtensionCodes, $aSelectedModules, $sSourc
531531
}
532532

533533
$oMFCompiler = new MFCompiler($oFactory, $sEnvironment);
534-
$oMFCompiler->Compile($sTargetPath, null, $bUseSymbolicLinks);
534+
$oMFCompiler->Compile($sTargetPath, null, $bUseSymbolicLinks, false, $bEnterMaintenanceMode);
535535
//$aCompilerLog = $oMFCompiler->GetLog();
536536
//SetupLog::Info(implode("\n", $aCompilerLog));
537537
SetupLog::Info("Data model successfully compiled to '$sTargetPath'.");

setup/sequencers/DataAuditSequencer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public function ExecuteStep($sStep = '', $sInstallComment = null)
5757
try {
5858
$fStart = microtime(true);
5959
SetupLog::Info("##### STEP {$sStep} start");
60-
$this->EnterReadOnlyMode();
6160
switch ($sStep) {
6261
case '':
6362
$this->DoLogParameters('data-audit-', 'Data Audit');
@@ -83,6 +82,7 @@ public function ExecuteStep($sStep = '', $sInstallComment = null)
8382
$aSelectedModules,
8483
$sSourceDir,
8584
$sExtensionDir,
85+
false,
8686
false
8787
);
8888

@@ -145,7 +145,6 @@ public function ExecuteStep($sStep = '', $sInstallComment = null)
145145
];
146146

147147
$this->ReportException($e);
148-
$this->ExitReadOnlyMode();
149148
} finally {
150149
$fDuration = round(microtime(true) - $fStart, 2);
151150
SetupLog::Info("##### STEP {$sStep} duration: {$fDuration}s");

0 commit comments

Comments
 (0)