ms client update

This commit is contained in:
2024-10-31 16:12:02 +03:00
parent 9d243b5b35
commit a02c55e16e
19 changed files with 75 additions and 142 deletions

View File

@ -411,4 +411,27 @@ class ModuleService
return $dependence_array;
}
public function isInstall(string $slug): bool
{
$module_paths = Option::where("key", "module_paths")->first();
$dirs = [];
if ($module_paths){
$path = json_decode($module_paths->value);
foreach ($path->paths as $p){
$dirs[] = getConst($p);
}
}
foreach ($dirs as $dir){
foreach (new DirectoryIterator($dir) as $fileInfo) {
if($fileInfo->isDot()) continue;
if ($this->getModuleInfo($fileInfo->getPathname())['slug'] === $slug) {
return true;
};
}
}
return false;
}
}