mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01: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:
@@ -490,11 +490,13 @@ class RunTimeEnvironment
|
||||
* The list of modules to be installed in the target environment is:
|
||||
* - the list of modules present in the "source_dir" (defined by the source environment) which are marked as "installed" in the source environment's database
|
||||
* - plus the list of modules present in the "extra" directory of the target environment: data/<target_environment>-modules/
|
||||
*
|
||||
* @param string $sSourceEnv The name of the source environment to 'imitate'
|
||||
* @param bool $bUseSymLinks Whether to create symbolic links instead of copies
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function CompileFrom($sSourceEnv, $bUseSymLinks = false)
|
||||
public function CompileFrom($sSourceEnv, $bUseSymLinks = null)
|
||||
{
|
||||
$oSourceConfig = new Config(utils::GetConfigFilePath($sSourceEnv));
|
||||
$sSourceDir = $oSourceConfig->Get('source_dir');
|
||||
@@ -504,7 +506,7 @@ class RunTimeEnvironment
|
||||
//
|
||||
$oFactory = new ModelFactory($sSourceDirFull);
|
||||
$aModulesToCompile = $this->GetMFModulesToCompile($sSourceEnv, $sSourceDir);
|
||||
foreach($aModulesToCompile as $oModule)
|
||||
foreach ($aModulesToCompile as $oModule)
|
||||
{
|
||||
if ($oModule instanceof MFDeltaModule)
|
||||
{
|
||||
@@ -514,15 +516,12 @@ class RunTimeEnvironment
|
||||
}
|
||||
$oFactory->LoadModule($oModule);
|
||||
}
|
||||
|
||||
|
||||
if ($oModule instanceof MFDeltaModule)
|
||||
{
|
||||
|
||||
if ($oModule instanceof MFDeltaModule) {
|
||||
// A delta was loaded, let's save a second copy of the datamodel
|
||||
$oFactory->SaveToFile(APPROOT.'data/datamodel-'.$this->sTargetEnv.'-with-delta.xml');
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
// No delta was loaded, let's save the datamodel now
|
||||
$oFactory->SaveToFile(APPROOT.'data/datamodel-'.$this->sTargetEnv.'.xml');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user