Compare commits

...

3 Commits

Author SHA1 Message Date
Timmy38
7fce0cc7af N°9503 Fix broken symlink in setup wizard 2026-04-13 15:19:34 +02:00
Timmy38
8172910c8b N°9503 Fix broken symlink in setup wizard 2026-04-13 14:28:22 +02:00
odain
1222507205 N°9500 - Designer - Can't mtp - OQL errors 2026-04-13 11:48:18 +02:00
5 changed files with 17 additions and 9 deletions

View File

@@ -17,7 +17,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see <http://www.gnu.org/licenses/>
require_once(APPROOT.'setup/setuppage.class.inc.php');
//require_once(APPROOT.'setup/setuppage.class.inc.php');
/**
* Class ModuleInstaller

View File

@@ -54,10 +54,9 @@ class DataAuditSequencer extends StepSequencer
$aSelectedModules = $this->oParams->Get('selected_modules', []);
$sSourceDir = $this->oParams->Get('source_dir', 'datamodels/latest');
$sExtensionDir = $this->oParams->Get('extensions_dir', 'extensions');
$aMiscOptions = $this->oParams->Get('options', []);
$aRemovedExtensionCodes = $this->oParams->Get('removed_extensions', []);
$bUseSymbolicLinks = $aMiscOptions['symlinks'] ?? false;
$sMessage = $bUseSymbolicLinks ? '' : 'Using symbolic links instead of copying data model files (for developers only!)';
$bUseSymbolicLinks = $this->oParams->Get('use-symbolic-links', null) === 'on';
$sMessage = $bUseSymbolicLinks ? 'Using symbolic links instead of copying data model files (for developers only!)' : '';
$this->oRunTimeEnvironment->DoCompile(
$aRemovedExtensionCodes,
$aSelectedModules,

View File

@@ -846,14 +846,19 @@ class SetupUtils
// Skip
continue;
}
if (is_dir($sSource.'/'.$sFile)) {
$sSourcePath = $sSource.'/'.$sFile;
$sDestPath = $sDest.'/'.$sFile;
if (is_dir($sSourcePath)) {
// Recurse
self::copydir($sSource.'/'.$sFile, $sDest.'/'.$sFile, $bUseSymbolicLinks);
self::copydir($sSourcePath, $sDestPath, $bUseSymbolicLinks);
} elseif (is_link($sSourcePath)) {
$sLinkPath = readlink($sSourcePath);
symlink($sLinkPath, $sDestPath);
} else {
if ($bUseSymbolicLinks) {
symlink($sSource.'/'.$sFile, $sDest.'/'.$sFile);
symlink($sSourcePath, $sDestPath);
} else {
copy($sSource.'/'.$sFile, $sDest.'/'.$sFile);
copy($sSourcePath, $sDestPath);
}
}
}
@@ -862,6 +867,9 @@ class SetupUtils
} elseif (is_file($sSource)) {
if ($bUseSymbolicLinks) {
return symlink($sSource, $sDest);
} elseif (is_link($sSource)) {
$sLinkPath = readlink($sSource);
return symlink($sLinkPath, $sDest);
} else {
return copy($sSource, $sDest);
}

View File

@@ -41,6 +41,7 @@ class WizStepInstallMiscParams extends AbstractWizStepMiscParams
$this->oWizard->SaveParameter('application_url', '');
$this->oWizard->SaveParameter('graphviz_path', '');
$this->oWizard->SaveParameter('sample_data', 'yes');
$this->oWizard->SaveParameter('use-symbolic-links', false);
return new WizardState(WizStepModulesChoice::class, 'start_install');
}

View File

@@ -39,7 +39,7 @@ class WizStepUpgradeMiscParams extends AbstractWizStepMiscParams
{
$this->oWizard->SaveParameter('application_url', '');
$this->oWizard->SaveParameter('graphviz_path', '');
$this->oWizard->SaveParameter('use-symbolic-links', MFCompiler::UseSymbolicLinks());
$this->oWizard->SaveParameter('use-symbolic-links', false);
$this->oWizard->SaveParameter('force-uninstall', false);
return new WizardState(WizStepModulesChoice::class, 'start_upgrade');
}