mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 00:02:17 +02:00
N°6648 - Use \utils::GetDataPath() instead of hard-coded paths (#555)
* N°6648 - Use \utils::GetDataPath() instead of hard-coded paths * Update setup/applicationinstaller.class.inc.php Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com> --------- Co-authored-by: Thomas Casteleyn <thomas.casteleyn@super-visions.com>
This commit is contained in:
@@ -81,8 +81,8 @@ if (is_link($sPageEnvFullPath)) {
|
||||
$aPossibleBasePaths = [
|
||||
APPROOT.$sSourceDir,
|
||||
APPROOT.'extensions',
|
||||
APPROOT.'data/'.$sEnvironment.'-modules',
|
||||
APPROOT.'data/downloaded-extensions', // Hub connector
|
||||
utils::GetDataPath().$sEnvironment.'-modules',
|
||||
utils::GetDataPath().'downloaded-extensions', // Hub connector
|
||||
];
|
||||
} else {
|
||||
$aPossibleBasePaths = [$sEnvFullPath];
|
||||
|
||||
@@ -111,17 +111,17 @@ $sDotExecutable = MetaModel::GetConfig()->Get('graphviz_path');
|
||||
if (file_exists($sDotExecutable))
|
||||
{
|
||||
// create the file with Graphviz
|
||||
$sImageFilePath = APPROOT."data/lifecycle/".$sClass.".svg";
|
||||
if (!is_dir(APPROOT."data"))
|
||||
$sImageFilePath = utils::GetDataPath()."lifecycle/".$sClass.".svg";
|
||||
if (!is_dir(utils::GetDataPath()))
|
||||
{
|
||||
@mkdir(APPROOT."data");
|
||||
@mkdir(utils::GetDataPath());
|
||||
}
|
||||
if (!is_dir(APPROOT."data/lifecycle"))
|
||||
if (!is_dir(utils::GetDataPath()."lifecycle"))
|
||||
{
|
||||
@mkdir(APPROOT."data/lifecycle");
|
||||
@mkdir(utils::GetDataPath()."lifecycle");
|
||||
}
|
||||
$sDotDescription = GraphvizLifecycle($sClass);
|
||||
$sDotFilePath = APPROOT."data/lifecycle/{$sClass}.dot";
|
||||
$sDotFilePath = utils::GetDataPath()."lifecycle/{$sClass}.dot";
|
||||
|
||||
$rFile = @fopen($sDotFilePath, "w");
|
||||
@fwrite($rFile, $sDotDescription);
|
||||
|
||||
Reference in New Issue
Block a user