N°7847 - Extensions via interface not recognized

N°7803 - MTP from itophub/designer failing in itop 3.2.0
This commit is contained in:
Eric Espie
2024-10-10 17:59:50 +02:00
parent 3a4d9e64f8
commit 75520bfaf9
6 changed files with 243 additions and 68 deletions

View File

@@ -23,16 +23,16 @@ class DataModelDependantCache
{
if (!isset(self::$oInstance))
{
self::$oInstance = new DataModelDependantCache(utils::GetCachePath());
self::$oInstance = new DataModelDependantCache();
}
return self::$oInstance;
}
private ?string $sStorageRootDir; // Nullable for test purposes
private function __construct($sStorageRootDir)
private function __construct()
{
$this->sStorageRootDir = $sStorageRootDir;
$this->sStorageRootDir = null;
}
/**
@@ -146,10 +146,25 @@ class DataModelDependantCache
return $this->GetStorageRootDir()."/$sPool/";
}
/** Overridable for testing purposes */
/**
* for test purpose
*
* @return string
*/
protected function GetStorageRootDir(): string
{
// Could be forced by tests
return $this->sStorageRootDir ?? utils::GetCachePath();
}
/**
* for test purpose
*
* @param string $sStorageRootDir
*/
public function SetStorageRootDir(?string $sStorageRootDir): void
{
$this->sStorageRootDir = $sStorageRootDir;
}
}