module shop

This commit is contained in:
2024-12-04 15:36:11 +03:00
parent 0a76920800
commit 0671346ce8
6 changed files with 86 additions and 13 deletions

View File

@ -476,6 +476,10 @@ class ModuleService
if ($this->isServerAvailable()){
$modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug');
if (!$this->issetModuleShopToken()){
return false;
}
$modules_info = json_decode($modules_info->getBody()->getContents(), true);
$mod_info = $this->getModuleInfoBySlug($slug);
foreach ($modules_info as $mod) {
@ -516,4 +520,13 @@ class ModuleService
}
}
public function issetModuleShopToken(): bool
{
if (!empty($_ENV['MODULE_SHOP_TOKEN'])){
return true;
}
return false;
}
}