This commit is contained in:
2024-09-23 12:53:49 +03:00
7 changed files with 48 additions and 29 deletions

View File

@ -107,6 +107,7 @@ class ModuleService
{
$modules = [];
$module_paths = Option::where("key", "module_paths")->first();
$active_modules = Option::where("key", "active_modules")->first();
$dirs = [];
if ($module_paths) {
$path = json_decode($module_paths->value);
@ -115,13 +116,15 @@ class ModuleService
}
}
$active_modules = json_decode($active_modules->value, true);
foreach ($dirs as $dir) {
foreach (new DirectoryIterator($dir) as $fileInfo) {
if($fileInfo->isDot()) continue;
if($fileInfo->isDot() or !in_array($fileInfo->getFilename(), $active_modules['modules'])) continue;
$modules[] = $this->getModuleInfo($fileInfo->getPathname());
}
}
return $modules;
}