mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°9412 - Screen Analysis results wip + test endpoint
This commit is contained in:
@@ -13,6 +13,7 @@ require_once APPROOT.'setup/feature_removal/DryRemovalRuntimeEnvironment.php';
|
|||||||
use Combodo\iTop\Application\TwigBase\Controller\Controller;
|
use Combodo\iTop\Application\TwigBase\Controller\Controller;
|
||||||
use Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalException;
|
use Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalException;
|
||||||
use Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalHelper;
|
use Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalHelper;
|
||||||
|
use Combodo\iTop\DataFeatureRemoval\Helper\DataFeatureRemovalLog;
|
||||||
use Combodo\iTop\DataFeatureRemoval\Service\DataCleanupService;
|
use Combodo\iTop\DataFeatureRemoval\Service\DataCleanupService;
|
||||||
use Combodo\iTop\DataFeatureRemoval\Service\DataFeatureRemoverExtensionService;
|
use Combodo\iTop\DataFeatureRemoval\Service\DataFeatureRemoverExtensionService;
|
||||||
use Combodo\iTop\Setup\FeatureRemoval\DryRemovalRuntimeEnvironment;
|
use Combodo\iTop\Setup\FeatureRemoval\DryRemovalRuntimeEnvironment;
|
||||||
@@ -26,9 +27,11 @@ use utils;
|
|||||||
|
|
||||||
class DataFeatureRemovalController extends Controller
|
class DataFeatureRemovalController extends Controller
|
||||||
{
|
{
|
||||||
private array $aSelectedExtensionsForCheck = [];
|
private array $aRemovedExtensionsForCheck = [];
|
||||||
private array $aCountClassesToCleanup = [];
|
private array $aCountClassesToCleanup = [];
|
||||||
private array $aAnalysisDataTable = [];
|
private array $aAnalysisDataTable = [];
|
||||||
|
private array $aDeletionExecutionSummary = [];
|
||||||
|
|
||||||
private int $iCount = 0;
|
private int $iCount = 0;
|
||||||
|
|
||||||
public function OperationMain($sErrorMessage = null): void
|
public function OperationMain($sErrorMessage = null): void
|
||||||
@@ -75,7 +78,7 @@ class DataFeatureRemovalController extends Controller
|
|||||||
$this->m_sOperation = 'Main';
|
$this->m_sOperation = 'Main';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (count($this->aSelectedExtensionsForCheck) > 0) {
|
if (count($this->aRemovedExtensionsForCheck) > 0) {
|
||||||
$this->Analyze();
|
$this->Analyze();
|
||||||
}
|
}
|
||||||
$this->OperationMain();
|
$this->OperationMain();
|
||||||
@@ -87,10 +90,8 @@ class DataFeatureRemovalController extends Controller
|
|||||||
|
|
||||||
private function Analyze(): void
|
private function Analyze(): void
|
||||||
{
|
{
|
||||||
|
$this->Compile($this->aRemovedExtensionsForCheck);
|
||||||
$sSourceEnv = MetaModel::GetEnvironment();
|
$sSourceEnv = MetaModel::GetEnvironment();
|
||||||
$oDryRemovalRuntimeEnvironment = new DryRemovalRuntimeEnvironment($sSourceEnv, $this->aSelectedExtensionsForCheck);
|
|
||||||
$oDryRemovalRuntimeEnvironment->CompileFrom($sSourceEnv);
|
|
||||||
|
|
||||||
$oSetupAudit = new SetupAudit($sSourceEnv);
|
$oSetupAudit = new SetupAudit($sSourceEnv);
|
||||||
$aGetRemovedClasses = $oSetupAudit->RunDataAudit();
|
$aGetRemovedClasses = $oSetupAudit->RunDataAudit();
|
||||||
IssueLog::Debug(__METHOD__, null, ['aGetRemovedClasses' => $aGetRemovedClasses]);
|
IssueLog::Debug(__METHOD__, null, ['aGetRemovedClasses' => $aGetRemovedClasses]);
|
||||||
@@ -115,14 +116,78 @@ class DataFeatureRemovalController extends Controller
|
|||||||
|
|
||||||
IssueLog::Info(__METHOD__.' Extensions given in parameter', null, ['aAddedExtensions' => $aAddedExtensions, 'aRemovedExtensions' => $aRemovedExtensions]);
|
IssueLog::Info(__METHOD__.' Extensions given in parameter', null, ['aAddedExtensions' => $aAddedExtensions, 'aRemovedExtensions' => $aRemovedExtensions]);
|
||||||
|
|
||||||
|
$this->Compile(array_keys($aRemovedExtensions), false);
|
||||||
|
|
||||||
$sSourceEnv = MetaModel::GetEnvironment();
|
$sSourceEnv = MetaModel::GetEnvironment();
|
||||||
$oSetupAudit = new SetupAudit($sSourceEnv);
|
$oSetupAudit = new SetupAudit($sSourceEnv);
|
||||||
$aGetRemovedClasses = array_keys($oSetupAudit->RunDataAudit());
|
$aGetRemovedClasses = array_keys($oSetupAudit->RunDataAudit());
|
||||||
IssueLog::Debug(__METHOD__, null, ['aGetRemovedClasses' => $aGetRemovedClasses]);
|
IssueLog::Debug(__METHOD__, null, ['aGetRemovedClasses' => $aGetRemovedClasses]);
|
||||||
|
|
||||||
|
$aParams['sTransactionId'] = utils::GetNewTransactionId();
|
||||||
|
$aParams['aClasses'] = $aGetRemovedClasses;
|
||||||
|
|
||||||
|
[$aParams['aDeletionPlanSummary'], $aParams['iQueryCount'], $aParams['bDeletionPossible']] = $this->GetDeletionPlanSummaryTable($aGetRemovedClasses);
|
||||||
|
[$aParams['aDeletionExecutionSummary'], $aParams['bHasDeletionExecution']] = $this->GetExecutionSummaryTable();
|
||||||
|
|
||||||
|
$aParams['aAddedExtensions'] = $aAddedExtensions;
|
||||||
|
$aParams['aRemovedExtensions'] = $aRemovedExtensions;
|
||||||
|
$aParams['aExtensions'] = $this->GetExtensionsTableDiff($aAddedExtensions, $aRemovedExtensions);
|
||||||
|
|
||||||
|
$this->DisplayPage($aParams, 'AnalysisResult');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function Compile(array $aRemovedExtensions, bool $bForceCompilation = true): void
|
||||||
|
{
|
||||||
|
$sSourceEnv = MetaModel::GetEnvironment();
|
||||||
|
$sBuildDir = APPROOT."/env-$sSourceEnv-build";
|
||||||
|
$bIsDirEmpty = count(scandir($sBuildDir)) === 2;
|
||||||
|
|
||||||
|
if ($bIsDirEmpty || $bForceCompilation) {
|
||||||
|
$oRuntimeEnvironment = new DryRemovalRuntimeEnvironment($sSourceEnv, $aRemovedExtensions);
|
||||||
|
DataFeatureRemovalLog::Info(
|
||||||
|
__METHOD__,
|
||||||
|
null,
|
||||||
|
['sSourceEnv' => $sSourceEnv, 'sBuildDir' => $sBuildDir, 'bIsDirEmpty' => $bIsDirEmpty, glob("$sBuildDir/*")]
|
||||||
|
);
|
||||||
|
$oRuntimeEnvironment->CompileFrom($sSourceEnv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function GetExecutionSummaryTable(): array
|
||||||
|
{
|
||||||
|
$sName = 'ExcutionSummary';
|
||||||
|
|
||||||
|
$aTableData = [];
|
||||||
|
if (count($this->aDeletionExecutionSummary) === 0) {
|
||||||
|
return [$aTableData, false];
|
||||||
|
}
|
||||||
|
|
||||||
|
$aColumns = ['Class', 'Total Deleted Count' , 'Total Updated Count', 'Deleted Count' , 'Updated Count'];
|
||||||
|
$aRows = [];
|
||||||
|
foreach ($this->aDeletionExecutionSummary as $sClass => $oDeletionPlanSummaryEntity) {
|
||||||
|
$aRows[] = [
|
||||||
|
$sClass,
|
||||||
|
$oDeletionPlanSummaryEntity->iTotalDeletedCount,
|
||||||
|
$oDeletionPlanSummaryEntity->iTotalUpdatedCount,
|
||||||
|
$oDeletionPlanSummaryEntity->iDeletedCount,
|
||||||
|
$oDeletionPlanSummaryEntity->iUpdatedCount,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$aTableData = $this->GetTableData($sName, $aColumns, $aRows);
|
||||||
|
|
||||||
|
$bHasDeletionExecution = count($this->aDeletionExecutionSummary) === 0;
|
||||||
|
|
||||||
|
return [$aTableData, $bHasDeletionExecution];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function GetDeletionPlanSummaryTable(array $aRemovedClasses): array
|
||||||
|
{
|
||||||
|
$sName = 'DeletionPlanSummary';
|
||||||
$oDataCleanupService = new DataCleanupService();
|
$oDataCleanupService = new DataCleanupService();
|
||||||
$aDeletionPlanSummaryEntities = $oDataCleanupService->GetCleanupSummary($aGetRemovedClasses);
|
$aDeletionPlanSummaryEntities = $oDataCleanupService->GetCleanupSummary($aRemovedClasses);
|
||||||
$aColumns = ['Class', 'DeleteCount' , 'UpdateCount', 'IssueCount'];
|
$aColumns = ['Class', 'Delete Count' , 'Update Count', 'Issue Count'];
|
||||||
$aRows = [];
|
$aRows = [];
|
||||||
$iQueryCount = 0;
|
$iQueryCount = 0;
|
||||||
$bHasIssues = false;
|
$bHasIssues = false;
|
||||||
@@ -137,17 +202,7 @@ class DataFeatureRemovalController extends Controller
|
|||||||
$iQueryCount += $oDeletionPlanSummaryEntity->iDeleteCount;
|
$iQueryCount += $oDeletionPlanSummaryEntity->iDeleteCount;
|
||||||
$iQueryCount += $oDeletionPlanSummaryEntity->iUpdateCount;
|
$iQueryCount += $oDeletionPlanSummaryEntity->iUpdateCount;
|
||||||
}
|
}
|
||||||
|
return [$this->GetTableData($sName, $aColumns, $aRows), $iQueryCount, !$bHasIssues];
|
||||||
$aParams['sTransactionId'] = utils::GetNewTransactionId();
|
|
||||||
$aParams['aDeletionPlanSummary'] = $this->GetTableData('Extensions', $aColumns, $aRows);
|
|
||||||
$aParams['aClasses'] = $aGetRemovedClasses;
|
|
||||||
$aParams['iQueryCount'] = $iQueryCount;
|
|
||||||
$aParams['bDeletionPossible'] = !$bHasIssues;
|
|
||||||
$aParams['aAddedExtensions'] = $aAddedExtensions;
|
|
||||||
$aParams['aRemovedExtensions'] = $aRemovedExtensions;
|
|
||||||
$aParams['aExtensions'] = $this->GetExtensionsTableDiff($aAddedExtensions, $aRemovedExtensions);
|
|
||||||
|
|
||||||
$this->DisplayPage($aParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function OperationDeletionPlan(): void
|
public function OperationDeletionPlan(): void
|
||||||
@@ -186,27 +241,28 @@ class DataFeatureRemovalController extends Controller
|
|||||||
|
|
||||||
public function OperationDoDeletion(): void
|
public function OperationDoDeletion(): void
|
||||||
{
|
{
|
||||||
$aParams = [];
|
|
||||||
$this->ValidateTransactionId();
|
$this->ValidateTransactionId();
|
||||||
|
|
||||||
$aClasses = utils::ReadPostedParam('classes', null, utils::ENUM_SANITIZATION_FILTER_CLASS);
|
$aClasses = utils::ReadPostedParam('classes', null, utils::ENUM_SANITIZATION_FILTER_CLASS);
|
||||||
|
|
||||||
$oDataCleanupService = new DataCleanupService();
|
$oDataCleanupService = new DataCleanupService();
|
||||||
$aDeletionExecutionSummary = $oDataCleanupService->ExecuteCleanup($aClasses);
|
$aDeletionExecutionSummary = $oDataCleanupService->ExecuteCleanup($aClasses);
|
||||||
$aColumns = ['Class', 'DeletedCount' , 'UpdatedCount'];
|
|
||||||
$aRows = [];
|
|
||||||
foreach ($aDeletionExecutionSummary as $oDeletionExecutionSummaryEntity) {
|
foreach ($aDeletionExecutionSummary as $oDeletionExecutionSummaryEntity) {
|
||||||
$aRows[] = [
|
if (isset($this->aDeletionExecutionSummary[$oDeletionExecutionSummaryEntity->sClass])) {
|
||||||
$oDeletionExecutionSummaryEntity->sClass,
|
/** @var \Combodo\iTop\DataFeatureRemoval\Entity\DataCleanupSummaryEntity $oTotal */
|
||||||
$oDeletionExecutionSummaryEntity->iDeleteCount,
|
$oTotal = $this->aDeletionExecutionSummary[$oDeletionExecutionSummaryEntity->sClass];
|
||||||
$oDeletionExecutionSummaryEntity->iUpdateCount,
|
$oTotal->iTotalUpdateCount += $oDeletionExecutionSummaryEntity->iUpdateCount;
|
||||||
];
|
$oTotal->iTotalDeleteCount += $oDeletionExecutionSummaryEntity->iDeleteCount;
|
||||||
|
$oTotal->iUpdateCount = $oDeletionExecutionSummaryEntity->iUpdateCount;
|
||||||
|
$oTotal->iDeleteCount = $oDeletionExecutionSummaryEntity->iDeleteCount;
|
||||||
|
} else {
|
||||||
|
$oTotal = $oDeletionExecutionSummaryEntity;
|
||||||
|
}
|
||||||
|
$this->aDeletionExecutionSummary[$oDeletionExecutionSummaryEntity->sClass] = $oTotal;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aParams['sTransactionId'] = utils::GetNewTransactionId();
|
$this->OperationAnalysisResult();
|
||||||
$aParams['aDeletionExecutionSummary'] = $this->GetTableData('Extensions', $aColumns, $aRows);
|
|
||||||
|
|
||||||
$this->DisplayPage($aParams);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function GetExtensionsTableDiff(array $aAddedExtensions, array $aRemovedExtensions): array
|
private function GetExtensionsTableDiff(array $aAddedExtensions, array $aRemovedExtensions): array
|
||||||
@@ -256,7 +312,7 @@ HTML,
|
|||||||
if ($oExtension->bRemovedFromDisk) {
|
if ($oExtension->bRemovedFromDisk) {
|
||||||
$sDisabledHtml = 'disabled=""';
|
$sDisabledHtml = 'disabled=""';
|
||||||
$sChecked = 'checked';
|
$sChecked = 'checked';
|
||||||
} elseif (in_array($sCode, $this->aSelectedExtensionsForCheck)) {
|
} elseif (in_array($sCode, $this->aRemovedExtensionsForCheck)) {
|
||||||
$sChecked = 'checked';
|
$sChecked = 'checked';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +378,7 @@ HTML,
|
|||||||
*/
|
*/
|
||||||
public function ReadRemovedExtensions(): void
|
public function ReadRemovedExtensions(): void
|
||||||
{
|
{
|
||||||
if (count($this->aSelectedExtensionsForCheck) > 0) {
|
if (count($this->aRemovedExtensionsForCheck) > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,14 +386,14 @@ HTML,
|
|||||||
foreach ($aSelectedExtensionsFromUI as $sCode => $aData) {
|
foreach ($aSelectedExtensionsFromUI as $sCode => $aData) {
|
||||||
$sValue = $aData['enable'] ?? 'off';
|
$sValue = $aData['enable'] ?? 'off';
|
||||||
if (($sValue) === 'on') {
|
if (($sValue) === 'on') {
|
||||||
$this->aSelectedExtensionsForCheck[] = $sCode;
|
$this->aRemovedExtensionsForCheck[] = $sCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add source removed to check
|
// Add source removed to check
|
||||||
foreach (DataFeatureRemoverExtensionService::GetInstance()->ReadItopExtensions() as $sCode => $oExtension) {
|
foreach (DataFeatureRemoverExtensionService::GetInstance()->ReadItopExtensions() as $sCode => $oExtension) {
|
||||||
if ($oExtension->bRemovedFromDisk) {
|
if ($oExtension->bRemovedFromDisk) {
|
||||||
$this->aSelectedExtensionsForCheck[] = $sCode;
|
$this->aRemovedExtensionsForCheck[] = $sCode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ class DataCleanupSummaryEntity
|
|||||||
public int $iIssueCount = 0;
|
public int $iIssueCount = 0;
|
||||||
public int $iUpdateCount = 0;
|
public int $iUpdateCount = 0;
|
||||||
public int $iDeleteCount = 0;
|
public int $iDeleteCount = 0;
|
||||||
|
public int $iTotalUpdateCount = 0;
|
||||||
|
public int $iTotalDeleteCount = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sClass
|
* @param string $sClass
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class ObjectServiceSummary implements iObjectService
|
|||||||
public function Update(DBObject $oToUpdate, string $sAttCode, $value): void
|
public function Update(DBObject $oToUpdate, string $sAttCode, $value): void
|
||||||
{
|
{
|
||||||
$sClass = get_class($oToUpdate);
|
$sClass = get_class($oToUpdate);
|
||||||
DataFeatureRemovalLog::Info('Object to update', null, ['class' => $sClass, 'id' => $oToUpdate->GetKey(), 'code' => $sAttCode, 'value' => "$value"]);
|
DataFeatureRemovalLog::Debug('Object to update', null, ['class' => $sClass, 'id' => $oToUpdate->GetKey(), 'code' => $sAttCode, 'value' => "$value"]);
|
||||||
if (! array_key_exists($sClass, $this->aSummary)) {
|
if (! array_key_exists($sClass, $this->aSummary)) {
|
||||||
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ class ObjectServiceSummary implements iObjectService
|
|||||||
|
|
||||||
public function Delete(string $sClass, string $sId): void
|
public function Delete(string $sClass, string $sId): void
|
||||||
{
|
{
|
||||||
DataFeatureRemovalLog::Info('Object to delete', null, ['class' => $sClass, 'id' => $sId]);
|
DataFeatureRemovalLog::Debug('Object to delete', null, ['class' => $sClass, 'id' => $sId]);
|
||||||
if (!array_key_exists($sClass, $this->aSummary)) {
|
if (!array_key_exists($sClass, $this->aSummary)) {
|
||||||
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ class ObjectServiceSummary implements iObjectService
|
|||||||
|
|
||||||
public function SetIssue(string $sClass): void
|
public function SetIssue(string $sClass): void
|
||||||
{
|
{
|
||||||
DataFeatureRemovalLog::Info('Issue on object', null, ['class' => $sClass]);
|
DataFeatureRemovalLog::Debug('Issue on object', null, ['class' => $sClass]);
|
||||||
if (!array_key_exists($sClass, $this->aSummary)) {
|
if (!array_key_exists($sClass, $this->aSummary)) {
|
||||||
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
$this->aSummary[$sClass] = new DataCleanupSummaryEntity($sClass);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ class iTopExtensionsMap
|
|||||||
$this->ProcessWizardChoices($aStepInfo['alternatives']);
|
$this->ProcessWizardChoices($aStepInfo['alternatives']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO Add aModuleVersion from module definition on disk in extensions
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ use ContextTag;
|
|||||||
use CoreException;
|
use CoreException;
|
||||||
use Exception;
|
use Exception;
|
||||||
use IssueLog;
|
use IssueLog;
|
||||||
use MetaModel;
|
|
||||||
use SetupLog;
|
use SetupLog;
|
||||||
use utils;
|
use utils;
|
||||||
|
|
||||||
@@ -34,7 +33,7 @@ class ModelReflectionSerializer
|
|||||||
|
|
||||||
public function GetModelFromEnvironment(string $sEnv): array
|
public function GetModelFromEnvironment(string $sEnv): array
|
||||||
{
|
{
|
||||||
IssueLog::Info(__METHOD__, null, ['env' => $sEnv]);
|
IssueLog::Debug(__METHOD__, null, ['env' => $sEnv]);
|
||||||
|
|
||||||
$sPHPExec = trim(utils::GetConfig()->Get('php_path'));
|
$sPHPExec = trim(utils::GetConfig()->Get('php_path'));
|
||||||
$sOutput = "";
|
$sOutput = "";
|
||||||
|
|||||||
@@ -425,14 +425,15 @@ class ModuleDiscovery
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupLog::Info("Module considered as removed", null, ['extension_code' => $oExtension->sCode, 'module_name' => $sModuleName, 'module_version' => $sModuleVersion, ModuleFileReader::MODULE_FILE_PATH => $sCurrentModuleFilePath]);
|
IssueLog::Info("Module considered as removed", null, ['extension_code' => $oExtension->sCode, 'module_name' => $sModuleName, 'module_version' => $sModuleVersion, ModuleFileReader::MODULE_FILE_PATH => $sCurrentModuleFilePath]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($aNonMatchingPaths) > 0) {
|
if (count($aNonMatchingPaths) > 0) {
|
||||||
//add log for support
|
//add log for support
|
||||||
SetupLog::Debug("Module kept as it came from non removed extensions", null, ['module_name' => $sModuleName, 'module_version' => $sModuleVersion, ModuleFileReader::MODULE_FILE_PATH => $sModuleFilePath, 'non_matching_paths' => $aNonMatchingPaths]);
|
IssueLog::Info("Module kept as it came from non removed extensions", null, ['module_name' => $sModuleName, 'module_version' => $sModuleVersion, ModuleFileReader::MODULE_FILE_PATH => $sModuleFilePath, 'non_matching_paths' => $aNonMatchingPaths]);
|
||||||
}
|
}
|
||||||
|
IssueLog::Debug(__METHOD__.' Module loaded', null, ['name' => $sModuleName, 'version' => $sModuleVersion]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ class RunTimeEnvironment
|
|||||||
$this->sBuildEnv = $sEnvironment.'-build';
|
$this->sBuildEnv = $sEnvironment.'-build';
|
||||||
}
|
}
|
||||||
$this->oExtensionsMap = null;
|
$this->oExtensionsMap = null;
|
||||||
|
SetupLog::Enable(APPROOT.'log/setup.log');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1566,7 +1567,7 @@ class RunTimeEnvironment
|
|||||||
|
|
||||||
public function ExitMaintenanceMode(): void
|
public function ExitMaintenanceMode(): void
|
||||||
{
|
{
|
||||||
if (SetupUtils::IsInMaintenanceMode()){
|
if (SetupUtils::IsInMaintenanceMode()) {
|
||||||
SetupUtils::ExitMaintenanceMode();
|
SetupUtils::ExitMaintenanceMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,5 +40,5 @@
|
|||||||
</selected_modules>
|
</selected_modules>
|
||||||
<selected_extensions type="array">
|
<selected_extensions type="array">
|
||||||
</selected_extensions>
|
</selected_extensions>
|
||||||
<use_symbolic_links>off</use_symbolic_links>
|
<use_symbolic_links>on</use_symbolic_links>
|
||||||
</installation>
|
</installation>
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Combodo\iTop\Application\WebPage\NiceWebPage;
|
||||||
|
|
||||||
|
require_once(dirname(__DIR__, 6).'/approot.inc.php');
|
||||||
|
require_once(APPROOT.'application/startup.inc.php');
|
||||||
|
require_once(APPROOT.'setup/setuputils.class.inc.php');
|
||||||
|
|
||||||
|
$aParams = [
|
||||||
|
"exec_module" => "combodo-data-feature-removal",
|
||||||
|
"exec_page" => "index.php",
|
||||||
|
'exec_env' => 'production',
|
||||||
|
];
|
||||||
|
|
||||||
|
new ContextTag(ContextTag::TAG_SETUP);
|
||||||
|
$sToken = SetupUtils::CreateSetupToken();
|
||||||
|
|
||||||
|
$aPostParams = [
|
||||||
|
"auth_user" => 'admin',
|
||||||
|
"auth_pwd" => 'admin',
|
||||||
|
'login_mode' => 'form',
|
||||||
|
'operation' => 'AnalysisResult',
|
||||||
|
'aRemovedExtensions[itop-container-mgmt]' => 'Containerization',
|
||||||
|
'setup_token' => $sToken,
|
||||||
|
];
|
||||||
|
|
||||||
|
$sHiddenPostedInput = "";
|
||||||
|
foreach ($aPostParams as $sKey => $sVal) {
|
||||||
|
$sHiddenPostedInput .= <<<INPUT
|
||||||
|
<input type="hidden" name="$sKey" value="$sVal">
|
||||||
|
INPUT;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sRedirectURL = utils::GetAbsoluteUrlModulePage('combodo-data-feature-removal', 'index.php');
|
||||||
|
|
||||||
|
$sDiv = <<<DIV
|
||||||
|
<div id="_test" style="display: none;">
|
||||||
|
<form id="_form" action="$sRedirectURL" method="post">
|
||||||
|
$sHiddenPostedInput
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
DIV;
|
||||||
|
|
||||||
|
$sReadyJs = <<<JS
|
||||||
|
$("#_form").trigger("submit");
|
||||||
|
JS;
|
||||||
|
|
||||||
|
$oP = new NiceWebPage("TEST");
|
||||||
|
$oP->add($sDiv);
|
||||||
|
$oP->add_ready_script($sReadyJs);
|
||||||
|
$oP->output();
|
||||||
Reference in New Issue
Block a user