ms client update
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user