From 0ca330a9f0d49265faf06daa43e8c19c40b7ee32 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Fri, 25 Oct 2024 16:09:26 +0300 Subject: [PATCH] merge --- app/modules/tag/manifest.json | 2 +- kernel/services/ModuleService.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/modules/tag/manifest.json b/app/modules/tag/manifest.json index 87665ad..3967dd6 100644 --- a/app/modules/tag/manifest.json +++ b/app/modules/tag/manifest.json @@ -1,6 +1,6 @@ { "name": "Tags", - "version": "0.1", + "version": "0.2", "author": "ITGuild", "slug": "tag", "description": "Tags module", diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php index 80b140c..3439e17 100644 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -343,10 +343,15 @@ class ModuleService $tmpModuleDirFull = RESOURCES_DIR . '/tmp/ad/' . $moduleName . "/"; $fileHelper = new Files(); - $fileHelper->copy_folder(APP_DIR . '/modules/' . $moduleName, $tmpModuleDirFull . 'app/'); - $fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $tmpModuleDirFull . 'kernel/'); + $fileHelper->copy_folder(ROOT_DIR . $path, $tmpModuleDirFull . 'app/'); + if (file_exists(KERNEL_APP_MODULES_DIR . '/' . $moduleName)){ + $fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $tmpModuleDirFull . 'kernel/'); + } + else { + mkdir($tmpModuleDirFull . 'kernel/'); + } - if (!is_dir(RESOURCES_DIR . '/tmp/module')) { + if (!is_dir(RESOURCES_DIR . '/tmp/modules')) { mkdir(RESOURCES_DIR . '/tmp/modules', 0777, true); } $fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.itguild');