mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 18:48:51 +02:00
New symlink flag set by the compiler, new compile with symlinks checkbox in the setup (#190)
The flag consists of the new `data/.compilation-symlinks` file, which is included in the code base (but not available in the Combodo packages). It will be used and generated if and only if : * we are on a dev env (`\utils::IsDevelopmentEnvironment`) * the `symlink` PHP function exists The flag is generated low level in the compiler (\MFCompiler::DoCompile) In the setup, if the flag is present and all conditions are met then a new option will be displayed in the "Miscellaneous Parameters" wizard step. When unchecking/checking the flag will be updated accordingly by an ajax query. All other compiler consumers (Designer / Hub connectors, Core Update, scripts using `RunTimeEnvironment` class) will : * if they provide a value for the symlink option, it will be used * otherwise the flag will be used instead, if conditions are met
This commit is contained in:
@@ -1161,6 +1161,30 @@ class WizStepUpgradeMiscParams extends WizardStep
|
||||
});
|
||||
EOF
|
||||
);
|
||||
|
||||
if (MFCompiler::IsUseSymbolicLinksFlagPresent()) {
|
||||
$oPage->add('<fieldset>');
|
||||
$oPage->add('<legend>Dev parameters</legend>');
|
||||
$oPage->p('<input id="use-symbolic-links" type="checkbox" checked><label for="use-symbolic-links"> Create symbolic links instead of creating a copy in env-production (useful for debugging extensions)');
|
||||
$oPage->add('</fieldset>');
|
||||
$oPage->add_ready_script(<<<'JS'
|
||||
$("#use-symbolic-links").on("click", function() {
|
||||
var $this = $(this),
|
||||
bUseSymbolicLinks = $this.prop("checked");
|
||||
if (!bUseSymbolicLinks){
|
||||
if (!window.confirm("This will disable symbolic links generation.\nYou'll need the toolkit to restore this option.\n\nAre you sure ?")) {
|
||||
$this.prop("checked", true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var sAuthent = $('#authent_token').val();
|
||||
var oAjaxParams = { operation: 'toggle_use_symbolic_links', bUseSymbolicLinks: bUseSymbolicLinks, authent: sAuthent};
|
||||
$.post(GetAbsoluteUrlAppRoot()+'setup/ajax.dataloader.php', oAjaxParams);
|
||||
});
|
||||
JS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function AsyncAction(WebPage $oPage, $sCode, $aParameters)
|
||||
|
||||
Reference in New Issue
Block a user