This commit is contained in:
Bellord
2026-11-10 08:29:46 +03:00
parent e70a98e7b9
commit 11fee552c5
4 changed files with 42 additions and 9 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"id": "bx.nullable", "id": "bx.nullable",
"prefix": "bx_nullable", "prefix": "bx_nullable",
"namespace": "Bx\\Nullable", "namespace": "Bx\\Nullable",
"gitUrl": "https://bitbucket.org/bellord13/bx.null/", "repo": "https://gitea.ixrs.ru/bellord/bx.nullable.git",
"version": "1.0.0", "version": "1.0.0",
"date": "2026-01-01 00:00:00", "date": "2026-01-01 00:00:00",
"deps": ["wt.core"] "deps": ["wt.core"]
+3 -4
View File
@@ -2,14 +2,13 @@
declare(strict_types=1); declare(strict_types=1);
use Wt\Core\App\ModuleEntity;
use Wt\Core\App\ModuleCloner; use Wt\Core\App\ModuleCloner;
require './../wt.core/include.php'; require './../wt.core/include.php';
require './ModuleCloner.php'; require './ModuleCloner.php';
if (!isset($argv[1])) { if (!isset($argv[1])) {
echo "Error: Please provide the target module path as the first argument." . PHP_EOL; echo 'Error: Please provide the target module path as the first argument.' . PHP_EOL;
exit(1); exit(1);
} }
@@ -29,8 +28,8 @@ try {
$cloner = new ModuleCloner($sourceEntity, $targetEntity); $cloner = new ModuleCloner($sourceEntity, $targetEntity);
$cloner->clone(); $cloner->clone();
echo "Success: Module cloned successfully." . PHP_EOL; echo 'Success: Module cloned successfully.' . PHP_EOL;
} catch (Throwable $e) { } catch (Throwable $e) {
echo "Critical Error: " . $e->getMessage() . PHP_EOL; echo 'Critical Error: ' . $e->getMessage() . PHP_EOL;
exit(1); exit(1);
} }
+1 -1
View File
@@ -2,7 +2,7 @@
namespace Bx\Nullable\Interfaces; namespace Bx\Nullable\Interfaces;
class ITest interface ITest
{ {
} }
+37 -3
View File
@@ -1,3 +1,37 @@
1) создаем папку с модулем # 🛠️ Инструкция по созданию и настройке модулей
2) копируем и конфигурируем файл .module.json
3) запускаем php -f clone.php ../path_to_new_module ## 📁 Структура директорий
```text
└── 📁 local/
└── 📁 modules/
├── 📁 bx.nullable/
│ └── 📄 clone.php
├── 📁 comp.dev/
│ └── 📄 .module.json
└── 📁 wt.core/
```
## 🚀 Пошаговое руководство
1. **Создайте папку** с вашим новым модулем в директории `local/modules/`.
2. **Скопируйте и настройте** конфигурационный файл `.module.json` внутри созданной папки.
3. **Запустите скрипт клонирования**, выполнив команду в терминале:
```bash
php -f local/modules/bx.nullable/clone.php ../путь_к_новому_модулю
```
## 📄 Пример файла `.module.json`
Ниже представлен шаблон конфигурации для модуля:
```json
{
"id": "comp.dev",
"prefix": "comp_dev",
"namespace": "Comp\\Dev",
"repo": "git@git.ru:author/comp.dev.git",
"version": "1.0.0",
"date": "2026-01-01 00:00:00",
"deps": ["wt.core"]
}
```