refactor(runtime): 移除 v8 旧类名映射兼容层

彻底移除 v8 重构分支中遗留的 class_alias 兼容映射,避免新架构继续依赖旧包拆分时期的类名入口。

主要内容:

- 删除 System 公共引导中的 think\admin 旧模型与旧服务别名映射。

- 删除 Worker 公共引导中的 SystemQueue 与 ProcessService 旧别名映射。

- 删除 Worker HTTP 服务对 think\response\File 的运行时类映射。

- 增加架构边界测试,防止后续重新引入 class_alias 与旧仓库名。
This commit is contained in:
Anyon 2026-05-08 16:14:25 +08:00
parent 1ddee14de6
commit c0b41a43c7
4 changed files with 2 additions and 29 deletions

View File

@ -396,6 +396,8 @@ class ArchitectureBoundaryTest extends TestCase
'plugin\wemall\integration\\',
'plugin\wuma\Query',
'plugin\wuma\Script',
'class_' . 'alias(',
'ThinkAdmin' . 'Developer',
'usession(',
'user_session_store',
'user_session_touch',

View File

@ -32,23 +32,6 @@ if (!Container::getInstance()->bound(StorageManagerInterface::class) && class_ex
Container::getInstance()->bind(StorageManagerInterface::class, StorageManager::class);
}
foreach ([
'think\\admin\\model\\SystemAuth' => \plugin\system\model\SystemAuth::class,
'think\\admin\\model\\SystemBase' => \plugin\system\model\SystemBase::class,
'think\\admin\\model\\SystemFile' => \plugin\system\model\SystemFile::class,
'think\\admin\\model\\SystemMenu' => \plugin\system\model\SystemMenu::class,
'think\\admin\\model\\SystemNode' => \plugin\system\model\SystemNode::class,
'think\\admin\\model\\SystemOplog' => \plugin\system\model\SystemOplog::class,
'think\\admin\\model\\SystemUser' => \plugin\system\model\SystemUser::class,
'think\\admin\\service\\AdminService' => \plugin\system\service\AuthService::class,
'think\\admin\\service\\CaptchaService' => \plugin\system\service\CaptchaService::class,
'think\\admin\\service\\MenuService' => \plugin\system\service\MenuService::class,
'think\\admin\\service\\SystemService' => \plugin\system\service\SystemService::class,
] as $legacy => $target) {
if (!class_exists($legacy, false) && class_exists($target)) {
class_alias($target, $legacy);
}
}
if (!function_exists('auth')) {
/**

View File

@ -20,14 +20,6 @@ declare(strict_types=1);
use think\admin\Exception;
use think\admin\service\QueueService;
foreach ([
'think\\admin\\model\\SystemQueue' => \plugin\worker\model\SystemQueue::class,
'think\\admin\\service\\ProcessService' => \plugin\worker\service\ProcessService::class,
] as $legacy => $target) {
if (!class_exists($legacy, false) && class_exists($target)) {
class_alias($target, $legacy);
}
}
if (!function_exists('sysqueue')) {
/**

View File

@ -81,10 +81,6 @@ class HttpServer extends Server
Http::class => ThinkHttp::class,
]);
if (!class_exists('think\response\File', false)) {
class_alias(ThinkResponseFile::class, 'think\response\File');
}
RuntimeService::init($this->app)->initialize();
$this->app->http->warmup();