feat: 公共表更名 common/member 前缀 + 插件命令自动加载 + 版本 1.1.1

- 18 张公共表更名(addon/attachment/configure/links/spider_log/spider_stat/sms/notice/ad/task/prop/medal/help/card -> common_*,member_wallets->member_wallet,score_rule/score_log -> member_*,addon_config->common_addonconf),模型全部对齐新表名,Db 直引用清零
- Attachment 模型补  表名绑定,修复富文本上传查 wxapp_attachment 1146 隐患
- install.sql + 迁移 SQL:backend_admin/backend_role delete_at 默认 0,修复软删除(NULL != 0)误过滤导致后台菜单为空
- AppService::boot() 支持插件 info.php 声明 commands 自动注册插件命令(psr-4 自动加载,坏类名自动跳过)
- 各插件(haonav/mqttbroker/wxchat/articles/blog/forum 等)字段与配置同步调整
- 框架版本 1.1.0 -> 1.1.1
This commit is contained in:
ywxapp
2026-08-20 20:19:15 +08:00
parent 303f548664
commit 1d49e6f5ee
395 changed files with 13342 additions and 2012 deletions
+32 -9
View File
@@ -53,7 +53,7 @@ class AddonMake extends Make
$this->setName('addon:make')
->addArgument('addon', Argument::OPTIONAL, 'addon name, e.g. demo (required for build & generators)')
->addOption('action', 'a', Option::VALUE_REQUIRED, 'build|clear|controller|model|middleware|validate|event|listener|service|subscribe')
->addOption('name', 'n', Option::VALUE_OPTIONAL, 'class name for generator actions, e.g. User')
->addOption('name', null, Option::VALUE_OPTIONAL, 'class name for generator actions, e.g. User')
->addOption('api', null, Option::VALUE_NONE, 'controller: generate an api controller class.')
->addOption('plain', null, Option::VALUE_NONE, 'controller: generate an empty controller class.')
->addOption('cache', 'c', Option::VALUE_NONE, 'clear: clear cache file')
@@ -62,7 +62,7 @@ class AddonMake extends Make
->setDescription('Unified addon scaffold & class generator (build / clear / controller / model / middleware / validate / event / listener / service / subscribe)');
}
protected function execute(Input $input, Output $output): int
{
$addon = trim((string) $input->getArgument('addon'));
@@ -227,8 +227,12 @@ class AddonMake extends Make
mkdir($appPath . 'controller');
mkdir($appPath . 'controller/backend');
mkdir($appPath . 'controller/member');
mkdir($appPath . 'controller/api');
}
$this->buildIndexController($app, $namespace);
$this->buildIndexController($app, $namespace); // 前台 FrontendBase
$this->buildIndexController($app, $namespace, 'backend'); // BackendBase
$this->buildIndexController($app, $namespace, 'member'); // MemberBase
$this->buildIndexController($app, $namespace, 'api'); // ApiBase
if (! is_dir($appPath . 'lang')) {
mkdir($appPath . 'lang');
}
@@ -342,14 +346,25 @@ class AddonMake extends Make
* @param string $namespace 类库命名空间
* @return void
*/
public function buildIndexController(string $app, string $namespace): void
public function buildIndexController(string $app, string $namespace, string $area = ''): void
{
$suffix = $this->app->config->get('route.controller_suffix') ? 'Controller' : '';
$filename = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : '') . 'controller' . DIRECTORY_SEPARATOR . 'Index' . $suffix . '.php';
$dir = 'controller' . ($area !== '' ? DIRECTORY_SEPARATOR . $area : '');
$filename = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : '') . $dir . DIRECTORY_SEPARATOR . 'Index' . $suffix . '.php';
if (! is_file($filename)) {
$content = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . 'controller.stub');
$content = str_replace(['{%className%}', '{%actionSuffix%}', '{%namespace%}', '{%app_namespace%}'], ['Index', $suffix, $namespace . '\\controller', $namespace], $content);
$base_class = $area == 'backend' ? 'BackendBase' : ($area == 'member' ? 'MemberBase' : ($area == 'api' ? 'ApiBase' : 'FrontendBase'));
$content = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . 'controller.stub');
$content = str_replace(
[
'{%className%}',
'{%actionSuffix%}',
'{%namespace%}',
'{%app_namespace%}',
'{%baseClass%}'
],
['Index', $suffix, $namespace . ($area !== '' ? '\\controller\\' . $area : '\\controller'), $namespace, $base_class],
$content
);
$this->checkDirBuild(dirname($filename));
file_put_contents($filename, $content);
}
@@ -366,8 +381,16 @@ class AddonMake extends Make
{
$filename = $this->basePath . ($app ? $app . DIRECTORY_SEPARATOR : '') . 'route' . DIRECTORY_SEPARATOR . 'app.php';
if (! is_file($filename)) {
$content = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . 'route.stub');
$content = str_replace(
[
'{%app%}'
],
[$app],
$content
);
$this->checkDirBuild(dirname($filename));
file_put_contents($filename, "<?php" . PHP_EOL . "use think\\facade\\Route;" . PHP_EOL . PHP_EOL);
file_put_contents($filename, $content);
}
}