modules routs
This commit is contained in:
@ -77,6 +77,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);
|
||||
@ -85,13 +86,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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user