From e12bf58baf15b008b79a1e930c3123361425f8a1 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Wed, 23 Oct 2024 16:36:17 +0300 Subject: [PATCH 1/3] botstrap.php to kernel update --- kernel/console/controllers/KernelController.php | 9 +++++++++ kernel/services/ModuleService.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/console/controllers/KernelController.php b/kernel/console/controllers/KernelController.php index c59d7f4..147d84f 100644 --- a/kernel/console/controllers/KernelController.php +++ b/kernel/console/controllers/KernelController.php @@ -41,6 +41,14 @@ class KernelController extends ConsoleController $this->out->r("/bootstrap не найден", 'red'); } + if (file_exists(ROOT_DIR . '/bootstrap.php')) { + $tmpBootstrapPhpDirFull = RESOURCES_DIR . '/tmp/ad/kernel/bootstrap.php'; + copy(ROOT_DIR . '/bootstrap.php', $tmpBootstrapPhpDirFull); + $this->out->r("/bootstrap.php скопирован во временную папку", 'green'); + } else { + $this->out->r("/bootstrap.php не найден", 'red'); + } + if (file_exists(ROOT_DIR . '/.env.example')) { $tmpEnvDirFull = RESOURCES_DIR . '/tmp/ad/kernel/env.example'; copy(ROOT_DIR . '/.env.example', $tmpEnvDirFull); @@ -88,6 +96,7 @@ class KernelController extends ConsoleController if (isset($this->argv['bootstrap'])) { $this->files->recursiveRemoveDir(ROOT_DIR . '/bootstrap'); $this->files->copy_folder($tmpKernelDirFull . 'bootstrap' , ROOT_DIR . '/bootstrap'); + copy($tmpKernelDirFull . '/bootstrap.php' , ROOT_DIR . '/bootstrap.php'); } if (isset($this->argv['env'])) { diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php index 80b140c..79e023e 100644 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -346,7 +346,7 @@ class ModuleService $fileHelper->copy_folder(APP_DIR . '/modules/' . $moduleName, $tmpModuleDirFull . 'app/'); $fileHelper->copy_folder(KERNEL_APP_MODULES_DIR . '/' . $moduleName, $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'); From c2dfe632e7990d61754dda832a95aeacbf3637a6 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Thu, 24 Oct 2024 11:44:16 +0300 Subject: [PATCH 2/3] console msgs about modeule --- kernel/console/controllers/ModuleController.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/console/controllers/ModuleController.php b/kernel/console/controllers/ModuleController.php index 539b687..db59f58 100644 --- a/kernel/console/controllers/ModuleController.php +++ b/kernel/console/controllers/ModuleController.php @@ -24,7 +24,11 @@ class ModuleController extends ConsoleController if (file_exists(ROOT_DIR . $this->argv['path'])) { $moduleService = new ModuleService(); - $moduleService->installModule($this->argv['path']); + if ($moduleService->installModule($this->argv['path'])) { + $this->out->r("Модуль установлен", 'green'); + } else { + $this->out->r("Ошибка установки модуля", 'red'); + } } else { $this->out->r("Модуль не найден", 'red'); } @@ -42,6 +46,7 @@ class ModuleController extends ConsoleController if (file_exists(ROOT_DIR . $this->argv['path'])) { $moduleService = new ModuleService(); $moduleService->uninstallModule($this->argv['path']); + $this->out->r("Модуль удален", 'green'); } else { $this->out->r("Модуль не найден", 'red'); } @@ -59,6 +64,7 @@ class ModuleController extends ConsoleController if (file_exists(ROOT_DIR . $this->argv['path'])) { $moduleService = new ModuleService(); $moduleService->packModule($this->argv['path']); + $this->out->r("Модуль заархивирован", 'green'); } else { $this->out->r("Модуль не найден", 'red'); } @@ -74,7 +80,13 @@ class ModuleController extends ConsoleController } if (file_exists(ROOT_DIR . $this->argv['path'])) { $moduleService = new ModuleService(); - $moduleService->updateModule($this->argv['path']); + if ($moduleService->updateModule($this->argv['path'])) { + $this->out->r("Модуль обновлен", 'green'); + } else { + $this->out->r("Ошибка обновления модуля", 'red'); + } + } else { + $this->out->r("Модуль не найден", 'red'); } } From 5ec081022d3f9f236853d7f76214b0126757fde2 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Thu, 24 Oct 2024 11:49:19 +0300 Subject: [PATCH 3/3] module service some fix --- kernel/services/ModuleService.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/services/ModuleService.php b/kernel/services/ModuleService.php index 79e023e..bf65403 100644 --- a/kernel/services/ModuleService.php +++ b/kernel/services/ModuleService.php @@ -306,7 +306,6 @@ class ModuleService } $fileHelper->recursiveRemoveDir($tmpModuleDirFull); - var_dump($tmpModuleDirFull); return true; } @@ -349,7 +348,7 @@ class ModuleService if (!is_dir(RESOURCES_DIR . '/tmp/modules')) { mkdir(RESOURCES_DIR . '/tmp/modules', 0777, true); } - $fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.itguild'); + $fileHelper->pack($tmpModuleDirFull, RESOURCES_DIR . '/tmp/modules/' . $moduleName . '.igm'); $fileHelper->recursiveRemoveDir($tmpModuleDirFull); }