mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
The new 2.0 setup is under way...
SVN:trunk[2179]
This commit is contained in:
@@ -172,6 +172,11 @@ class ModuleDiscovery
|
||||
{
|
||||
$sLookupDir = realpath($sRootDir.'/'.$sSearchDir);
|
||||
|
||||
if (self::$m_sModulesRoot != $sLookupDir)
|
||||
{
|
||||
self::ResetCache();
|
||||
}
|
||||
|
||||
if (is_null(self::$m_sModulesRoot))
|
||||
{
|
||||
// First call
|
||||
@@ -186,10 +191,6 @@ class ModuleDiscovery
|
||||
self::ListModuleFiles($sSearchDir, $sRootDir);
|
||||
return self::GetModules($oP);
|
||||
}
|
||||
elseif (self::$m_sModulesRoot != $sLookupDir)
|
||||
{
|
||||
throw new Exception("Design issue: the discovery of modules cannot be made on two different paths (previous: ".self::$m_sModulesRoot.", new: $sLookupDir)");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reuse the previous results
|
||||
@@ -197,6 +198,13 @@ class ModuleDiscovery
|
||||
return self::GetModules($oP);
|
||||
}
|
||||
}
|
||||
|
||||
public static function ResetCache()
|
||||
{
|
||||
self::$m_sModulesRoot = null;
|
||||
self::$m_sModulesRoot = null;
|
||||
self::$m_aModules = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to interpret the name of a module
|
||||
|
||||
Reference in New Issue
Block a user