N°6097 - Add \utils::GetDataPath() method to avoid duplicating manual path build

This commit is contained in:
Molkobain
2023-08-03 16:49:06 +02:00
parent aef3c2e609
commit 851ab9c356

View File

@@ -1228,13 +1228,23 @@ class utils
}
}
/**
* @return string A path to the folder into which data can be written
* @internal
* @since N°6097 2.7.10 3.0.4 3.1.1
*/
public static function GetDataPath(): string
{
return APPROOT.'data/';
}
/**
* @return string A path to a folder into which any module can store cache data
* The corresponding folder is created or cleaned upon code compilation
*/
public static function GetCachePath()
{
return APPROOT.'data/cache-'.MetaModel::GetEnvironment().'/';
return static::GetDataPath().'cache-'.MetaModel::GetEnvironment().'/';
}
/**
* @return string A path to a folder into which any module can store log