mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°4020 - timeout on updating the hierarchical key during setup
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -26,6 +26,7 @@ test/vendor/*
|
||||
!/data/.htaccess
|
||||
!/data/index.php
|
||||
!/data/web.config
|
||||
!/data/.setup-rebuild-hkeys-never
|
||||
|
||||
# iTop extensions
|
||||
/extensions/**
|
||||
|
||||
@@ -51,6 +51,14 @@ class DOMFormatException extends Exception
|
||||
*/
|
||||
class MFCompiler
|
||||
{
|
||||
/**
|
||||
* Path to the "calculate hKeys" file
|
||||
* If this file is present, then we don't recalculate hkeys
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const REBUILD_HKEYS_NEVER= APPROOT.'data/.setup-rebuild-hkeys-never';
|
||||
|
||||
/** @var \ModelFactory */
|
||||
protected $oFactory;
|
||||
|
||||
@@ -96,7 +104,21 @@ class MFCompiler
|
||||
{
|
||||
return $this->aLog;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool possible return values :
|
||||
* * if flag is present true, false otherwise
|
||||
*
|
||||
* @uses \file_exists()
|
||||
* @uses REBUILD_HKEYS_NEVER
|
||||
*
|
||||
* @since 2.7.5
|
||||
*/
|
||||
public static function SkipRebuildHKeys(): bool
|
||||
{
|
||||
return (file_exists(static::REBUILD_HKEYS_NEVER));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Compile the data model into PHP files and data structures
|
||||
|
||||
@@ -599,11 +599,16 @@ class RunTimeEnvironment
|
||||
$this->log_ok("Database structure successfully updated.");
|
||||
|
||||
// Check (and update only if it seems needed) the hierarchical keys
|
||||
ob_start();
|
||||
MetaModel::CheckHKeys(false /* bDiagnosticsOnly */, true /* bVerbose*/, true /* bForceUpdate */); // Since in 1.2-beta the detection was buggy, let's force the rebuilding of HKeys
|
||||
$sFeedback = ob_get_clean();
|
||||
$this->log_ok("Hierchical keys rebuilt: $sFeedback");
|
||||
|
||||
if (MFCompiler::SkipRebuildHKeys()) {
|
||||
$this->log_ok("Hierchical keys are NOT rebuilt due to the presence of the \"data/.setup-rebuild-hkeys-never\" file");
|
||||
} else {
|
||||
ob_start();
|
||||
$this->log_ok("Start of rebuilt of hierchical keys. If you have problems with this step, you can skip it by creating a \".setup-rebuild-hkeys-never\" file in data");
|
||||
MetaModel::CheckHKeys(false /* bDiagnosticsOnly */, true /* bVerbose*/, true /* bForceUpdate */); // Since in 1.2-beta the detection was buggy, let's force the rebuilding of HKeys
|
||||
$sFeedback = ob_get_clean();
|
||||
$this->log_ok("Hierchical keys rebuilt: $sFeedback");
|
||||
}
|
||||
|
||||
// Check (and fix) data sync configuration
|
||||
ob_start();
|
||||
MetaModel::CheckDataSources(false /*$bDiagnostics*/, true/*$bVerbose*/);
|
||||
|
||||
Reference in New Issue
Block a user