Skip to content

Commit c486d06

Browse files
committed
fix: install the dependencies even if they are not loaded yet. (#148)
1 parent 986a8db commit c486d06

3 files changed

Lines changed: 31 additions & 0 deletions

File tree

src/Classes/DependencyManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public function __construct()
3838
*/
3939
public function getAllModules($module): array
4040
{
41+
$moduleLoader = ModuleLoader::getModuleLoader();
42+
$moduleLoader->resetCache();
43+
4144
$requireModulesTree = $this->buildTreeByModule($module);
4245

4346
$requireModules = [];

src/Classes/Loader/ModuleLoader.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ public static function getModuleLoader(): ModuleLoader
2929
return self::$moduleLoader;
3030
}
3131

32+
/**
33+
* Resets / deletes allready loaded modules data. For examplae because
34+
* during the script runtime the amount of modules or data of modules
35+
* changed and the ModuleLoader does not give the latest module
36+
* informations.
37+
*/
38+
public function resetCache()
39+
{
40+
$this->cachedModules = [];
41+
42+
$remoteModuleLoader = RemoteModuleLoader::getModuleLoader();
43+
$remoteModuleLoader->resetCache();
44+
45+
$localModules = LocalModuleLoader::getModuleLoader();
46+
$localModules->resetCache();
47+
}
48+
3249
/**
3350
* Loads all local module version plus all latest remote module version.
3451
*

src/Classes/Loader/RemoteModuleLoader.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ public function __construct(ApiRequest $apiRequest, ApiV1ModuleConverter $module
3434
$this->moduleConverter = $moduleConverter;
3535
}
3636

37+
/**
38+
* Resets / deletes allready loaded modules data. For examplae because
39+
* during the script runtime the amount of modules or data of modules
40+
* changed and the RemoteModuleLoader does not give the latest module
41+
* informations.
42+
*/
43+
public function resetCache()
44+
{
45+
$this->cachedModules = [];
46+
}
47+
3748
public static function getModuleLoader(): RemoteModuleLoader
3849
{
3950
if (!self::$moduleLoader) {

0 commit comments

Comments
 (0)