The new 2.0 setup is under way...

SVN:trunk[2179]
This commit is contained in:
Denis Flaven
2012-09-12 13:31:46 +00:00
parent 4cfeae9ca0
commit 5eb97ae133
8 changed files with 2015 additions and 5 deletions

View File

@@ -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