photo settings

This commit is contained in:
2024-12-02 16:25:28 +03:00
parent 567ab8544d
commit a1bed2d9f2
9 changed files with 125 additions and 78 deletions

View File

@ -4,11 +4,13 @@ namespace kernel\services;
use DirectoryIterator;
use kernel\EntityRelation;
use kernel\Flash;
use kernel\helpers\Debug;
use kernel\helpers\Files;
use kernel\helpers\Manifest;
use kernel\helpers\RESTClient;
use kernel\models\Option;
use MongoDB\Driver\Session;
use ZipArchive;
class ModuleService
@ -359,8 +361,6 @@ class ModuleService
mkdir(RESOURCES_DIR . '/tmp/modules', 0777, true);
}
$fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.igm');
//$fileHelper->recursiveRemoveDir($tmpModuleDirFull);
}
/**
@ -442,14 +442,18 @@ class ModuleService
public function isLastVersion(string $slug): bool
{
$modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug');
try {
$modules_info = RESTClient::request($_ENV['MODULE_SHOP_URL'] . '/api/module_shop/gb_slug');
$modules_info = json_decode($modules_info->getBody()->getContents(), true);
$mod_info = $this->getModuleInfoBySlug($slug);
foreach ($modules_info as $mod) {
if ($mod['slug'] === $mod_info['slug'] && $mod['version'] === $mod_info['version']) {
return true;
$modules_info = json_decode($modules_info->getBody()->getContents(), true);
$mod_info = $this->getModuleInfoBySlug($slug);
foreach ($modules_info as $mod) {
if ($mod['slug'] === $mod_info['slug'] && $mod['version'] === $mod_info['version']) {
return true;
}
}
} catch (\Exception $e) {
throw new \Exception("Не удалось получить доступ к магазину модулей");
}
return false;