mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-20 15:52:24 +02:00
Add Fast setup for developers
This commit is contained in:
@@ -7,17 +7,20 @@
|
||||
|
||||
namespace Combodo\iTop\CoreUpdate\Controller;
|
||||
|
||||
require_once APPROOT.'setup/runtimeenv.class.inc.php';
|
||||
|
||||
use Combodo\iTop\Application\TwigBase\Controller\Controller;
|
||||
use Combodo\iTop\CoreUpdate\Service\CoreUpdater;
|
||||
use Combodo\iTop\DBTools\Service\DBToolsUtils;
|
||||
use Combodo\iTop\FilesInformation\Service\FileNotExistException;
|
||||
use Combodo\iTop\FilesInformation\Service\FilesInformation;
|
||||
use Config;
|
||||
use ContextTag;
|
||||
use Dict;
|
||||
use Exception;
|
||||
use IssueLog;
|
||||
use MetaModel;
|
||||
use RunTimeEnvironment;
|
||||
use SecurityException;
|
||||
use SetupUtils;
|
||||
use utils;
|
||||
@@ -258,6 +261,30 @@ class AjaxController extends Controller
|
||||
$this->DisplayJSONPage($aParams, $iResponseCode);
|
||||
}
|
||||
|
||||
function OperationRebuildToolkitEnvironment()
|
||||
{
|
||||
$sTransactionId = utils::GetNewTransactionId();
|
||||
$aParams = [];
|
||||
$aParams['sTransactionId'] = $sTransactionId;
|
||||
$aParams['bStatus'] = true;
|
||||
|
||||
$iResponseCode = 200;
|
||||
try {
|
||||
$aParams['sAjaxURL'] = utils::GetAbsoluteUrlAppRoot().'/pages/UI.php';
|
||||
$oConfig = new Config(APPCONF.'production'.'/'.ITOP_CONFIG_FILE);
|
||||
$oEnvironment = new RunTimeEnvironment('production');
|
||||
$oEnvironment->WriteConfigFileSafe($oConfig);
|
||||
$oEnvironment->CompileFrom('production');
|
||||
}
|
||||
catch (Exception $e) {
|
||||
IssueLog::Error('RebuildToolkitEnvironment: '.$e->getMessage());
|
||||
$aParams['sError'] = $e->getMessage();
|
||||
$iResponseCode = 500;
|
||||
$aParams['bStatus'] = false;
|
||||
}
|
||||
$this->DisplayJSONPage($aParams, $iResponseCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \SecurityException if CSRF token invalid
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user