From fc188482d01114abd652e144db9ef5c3854a4200 Mon Sep 17 00:00:00 2001 From: stasbilay02 Date: Fri, 13 Dec 2024 16:48:53 +0300 Subject: [PATCH] additional info to routs add --- .../2024_11_28_133527_create_photo_table.php | 2 + kernel/console/Out.php | 14 ++++ kernel/console/routs/cli.php | 72 +++++++++++++++---- .../2024_09_23_125545_create_menu_table.php | 1 + .../2024_09_23_125716_create_option_table.php | 1 + ..._12_09_081420_create_secret_code_table.php | 2 + .../2024_09_23_125827_create_user_table.php | 2 + 7 files changed, 79 insertions(+), 15 deletions(-) diff --git a/kernel/app_modules/photo/migrations/2024_11_28_133527_create_photo_table.php b/kernel/app_modules/photo/migrations/2024_11_28_133527_create_photo_table.php index eb30db6..b98c968 100644 --- a/kernel/app_modules/photo/migrations/2024_11_28_133527_create_photo_table.php +++ b/kernel/app_modules/photo/migrations/2024_11_28_133527_create_photo_table.php @@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { + public string $migration; + /** * Run the migrations. */ diff --git a/kernel/console/Out.php b/kernel/console/Out.php index 7baa8ac..ed1441c 100644 --- a/kernel/console/Out.php +++ b/kernel/console/Out.php @@ -4,6 +4,8 @@ namespace kernel\console; +use kernel\helpers\Debug; + class Out { private $foreground_colors = array(); @@ -80,4 +82,16 @@ class Out { return array_keys($this->background_colors); } + +// public function printHeaderTable(): void +// { +// echo "\n+-----------------------------+-----------------------------+-----------------------------+-----------------------------+\n"; +// printf("%-30s", "| Routs"); +// printf("%-30s", "| Description"); +// printf("%-30s", "| Params"); +// printf("%-30s", "| Params description"); +// printf("%-30s", "|"); +// echo "\n+-----------------------------+-----------------------------+-----------------------------+-----------------------------+\n"; +// } + } \ No newline at end of file diff --git a/kernel/console/routs/cli.php b/kernel/console/routs/cli.php index da1b681..d0f1032 100644 --- a/kernel/console/routs/cli.php +++ b/kernel/console/routs/cli.php @@ -20,35 +20,77 @@ App::$collector->group(["prefix" => "migration"], callback: function (RouteColle [MigrationController::class, 'actionCreate'], additionalInfo: ['description' => 'Создание миграции', 'params' => ['--name' => 'Название миграции', '--path' => 'Путь по которому будет создана миграция']] ); - App::$collector->console('rollback', [MigrationController::class, 'actionRollback']); + App::$collector->console('rollback', + [MigrationController::class, 'actionRollback'], + additionalInfo: ['description' => 'Откатить миграции'] + ); }); App::$collector->group(["prefix" => "admin-theme"], callback: function (RouteCollector $router){ - App::$collector->console('install', [\kernel\console\controllers\AdminThemeController::class, 'actionInstallTheme']); - App::$collector->console('uninstall', [\kernel\console\controllers\AdminThemeController::class, 'actionUninstallTheme']); + App::$collector->console('install', + [\kernel\console\controllers\AdminThemeController::class, 'actionInstallTheme'], + additionalInfo: ['description' => 'Установить тему админ-панели', 'params' => ['--path' => 'Путь к устанавливаемой теме']] + ); + App::$collector->console('uninstall', + [\kernel\console\controllers\AdminThemeController::class, 'actionUninstallTheme'], + additionalInfo: ['description' => 'Удалить тему админ-панели', 'params' => ['--path' => 'Путь к удаляемой теме']] + ); }); App::$collector->group(["prefix" => "secure"], callback: function (RouteCollector $router){ - App::$collector->console('create-secret-key', [\kernel\console\controllers\SecureController::class, 'actionCreateSecretKey']); + App::$collector->console('create-secret-key', + [\kernel\console\controllers\SecureController::class, 'actionCreateSecretKey'], + additionalInfo: ['description' => 'Генерация секрктного ключа и запись его в .env'] + ); }); App::$collector->group(["prefix" => "admin"], callback: function (RouteCollector $router){ - App::$collector->console('init', [\kernel\console\controllers\AdminConsoleController::class, 'actionInit']); + App::$collector->console('init', + [\kernel\console\controllers\AdminConsoleController::class, 'actionInit'], + additionalInfo: ['description' => 'Инициализация админ-панели'] + ); }); App::$collector->group(["prefix" => "module"], callback: function (RouteCollector $router){ - App::$collector->console('install', [\kernel\console\controllers\ModuleController::class, 'actionInstallModule']); - App::$collector->console('uninstall', [\kernel\console\controllers\ModuleController::class, 'actionUninstallModule']); - App::$collector->console('pack', [\kernel\console\controllers\ModuleController::class, 'actionPackModule']); - App::$collector->console('update', [\kernel\console\controllers\ModuleController::class, 'actionUpdateModule']); - App::$collector->console('construct', [\kernel\console\controllers\ModuleController::class, 'actionConstructModule']); - App::$collector->console('mk', [\kernel\console\controllers\ModuleController::class, 'actionMk']); + App::$collector->console('install', + [\kernel\console\controllers\ModuleController::class, 'actionInstallModule'], + additionalInfo: ['description' => 'Установка модуля', 'params' => ['--path' => 'Путь к устанавливаемому модулю']] + ); + App::$collector->console('uninstall', + [\kernel\console\controllers\ModuleController::class, 'actionUninstallModule'], + additionalInfo: ['description' => 'Удалить модуль', 'params' => ['--path' => 'Путь к удаляемому модулю']] + ); + App::$collector->console('pack', + [\kernel\console\controllers\ModuleController::class, 'actionPackModule'], + additionalInfo: ['description' => 'Заархивировать модуль', 'params' => ['--path' => 'Путь к модулю, который нужно заархивировать']] + ); + App::$collector->console('update', + [\kernel\console\controllers\ModuleController::class, 'actionUpdateModule'], + additionalInfo: ['description' => 'Обновить модуль', 'params' => ['--path' => 'Путь к архиву с модулем']] + ); + App::$collector->console('construct', + [\kernel\console\controllers\ModuleController::class, 'actionConstructModule'], + additionalInfo: ['description' => 'Сгенерировать модуль'] + ); }); App::$collector->group(["prefix" => "kernel"], callback: function (RouteCollector $router){ -// App::$collector->console('install', [\kernel\console\controllers\ModuleController::class, 'actionInstallModule']); -// App::$collector->console('uninstall', [\kernel\console\controllers\ModuleController::class, 'actionUninstallModule']); - App::$collector->console('pack', [\kernel\console\controllers\KernelController::class, 'actionPackKernel']); - App::$collector->console('update', [\kernel\console\controllers\KernelController::class, 'actionUpdateKernel']); + App::$collector->console('pack', + [\kernel\console\controllers\KernelController::class, 'actionPackKernel'], + additionalInfo: ['description' => 'Заархивировать ядро', 'params' => ['--path' => 'Путь к ядру']] + ); + App::$collector->console('update', + [\kernel\console\controllers\KernelController::class, 'actionUpdateKernel'], + additionalInfo: [ + 'description' => 'Обновить модуль', + 'params' => + [ + '--path' => 'Путь к архиву ядра', + 'bootstrap' => 'Обновить bootstrap', + 'composer' => 'Обновить composer', + 'env' => 'Обновить .env.example' + ] + ] + ); }); diff --git a/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php b/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php index 60ee3b6..c27b7a9 100644 --- a/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php +++ b/kernel/modules/menu/migrations/2024_09_23_125545_create_menu_table.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { + public string $migration; /** * Run the migrations. */ diff --git a/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php b/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php index d2468a7..17edd23 100644 --- a/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php +++ b/kernel/modules/option/migrations/2024_09_23_125716_create_option_table.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { + public string $migration; /** * Run the migrations. */ diff --git a/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php b/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php index c5acce1..a6ab989 100644 --- a/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php +++ b/kernel/modules/secure/migrations/2024_12_09_081420_create_secret_code_table.php @@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { + public string $migration; + /** * Run the migrations. */ diff --git a/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php b/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php index 774213a..a762579 100644 --- a/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php +++ b/kernel/modules/user/migrations/2024_09_23_125827_create_user_table.php @@ -6,6 +6,8 @@ use Illuminate\Support\Facades\Schema; return new class extends Migration { + public string $migration; + /** * Run the migrations. *