refactor: rename the theme brand and every identifier from AKSRT to Jio
Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.
Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)
Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
(dropped 3 stale entries, added the 17 missing ones)
Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
when it is empty
Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.
Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5b16bc6e15
commit
35bb96e82f
997 files changed
+28216
-28188
No files matched your search
@@ -2,9 +2,9 @@
|
||||
|
||||
/**
|
||||
* 工单表结构契约:
|
||||
* 1) 6 张 aksrt_ticket* 表全部由 DBMigratorPart2 建出,且被 migrate_ticket_tables() 调用;
|
||||
* 2) SCHEMA_VERSION 已升到 3.2.0(dbDelta 只在版本变化时重跑);
|
||||
* 3) aksrt_order_aftersale 已从 schema 与表名映射中彻底移除;
|
||||
* 1) 6 张 jio_ticket* 表全部由 DBMigratorPart2 建出,且被 migrate_ticket_tables() 调用;
|
||||
* 2) SCHEMA_VERSION 已升到 3.3.0(dbDelta 只在版本变化时重跑);
|
||||
* 3) jio_order_aftersale 已从 schema 与表名映射中彻底移除;
|
||||
* 4) 状态与部门 seeds 幂等,默认状态被标记为不可改删。
|
||||
*/
|
||||
|
||||
@@ -17,21 +17,23 @@ const root = path.resolve(__dirname, '../..');
|
||||
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
||||
|
||||
const TABLES = [
|
||||
'aksrt_ticket',
|
||||
'aksrt_ticket_reply',
|
||||
'aksrt_ticket_status',
|
||||
'aksrt_ticket_type',
|
||||
'aksrt_ticket_prereply',
|
||||
'aksrt_ticket_note',
|
||||
'jio_ticket',
|
||||
'jio_ticket_reply',
|
||||
'jio_ticket_status',
|
||||
'jio_ticket_type',
|
||||
'jio_ticket_prereply',
|
||||
'jio_ticket_note',
|
||||
];
|
||||
|
||||
test('schema version is bumped so dbDelta re-runs', () => {
|
||||
const migrator = read('src/Core/DBMigrator.php');
|
||||
assert.match(migrator, /const SCHEMA_VERSION = '3\.2\.0';/, 'SCHEMA_VERSION must be 3.2.0');
|
||||
assert.match(migrator, /const SCHEMA_VERSION = '3\.3\.0';/, 'SCHEMA_VERSION must be 3.3.0');
|
||||
assert.ok(migrator.includes('use DBMigratorTicket;'), 'DBMigratorTicket trait not composed');
|
||||
// 版本注释要说明每次升版做了什么,否则后人看不懂升版原因。
|
||||
assert.match(migrator, /3\.0\.0: 售后(order_aftersale)整体替换为工单系统/);
|
||||
assert.match(migrator, /3\.1\.0: aksrt_ticket 新增 urge_count \/ last_urge_time/);
|
||||
assert.match(migrator, /3\.1\.0: jio_ticket 新增 urge_count \/ last_urge_time/);
|
||||
// 3.3.0 的品牌重命名(aksrt_ → jio_ 表前缀)也必须写进注释。
|
||||
assert.match(migrator, /3\.3\.0: 主题品牌由 AKSRT 更名为 Jio/);
|
||||
const ticket = read('src/Core/DBMigratorTicket.php');
|
||||
assert.match(ticket, /urge_count INT UNSIGNED NOT NULL DEFAULT 0,/);
|
||||
assert.match(ticket, /last_urge_time DATETIME DEFAULT NULL,/);
|
||||
@@ -41,9 +43,9 @@ test('order_aftersale is gone from schema and the table map', () => {
|
||||
const part2 = read('src/Core/DBMigratorPart2.php');
|
||||
const part3 = read('src/Core/DBMigratorPart3.php');
|
||||
|
||||
assert.ok(!part2.includes('aksrt_order_aftersale'), 'order_aftersale CREATE must be removed');
|
||||
assert.ok(!part2.includes('jio_order_aftersale'), 'order_aftersale CREATE must be removed');
|
||||
assert.ok(!part3.includes("'order_aftersale'"), 'order_aftersale table map entry must be removed');
|
||||
assert.ok(!part3.includes('aksrt_order_aftersale'), 'order_aftersale table name must be removed');
|
||||
assert.ok(!part3.includes('jio_order_aftersale'), 'order_aftersale table name must be removed');
|
||||
});
|
||||
|
||||
test('six ticket tables are declared and the migrator is invoked', () => {
|
||||
@@ -51,7 +53,7 @@ test('six ticket tables are declared and the migrator is invoked', () => {
|
||||
// Part2 只负责调用;DDL 集中在 DBMigratorTicket,避免 run() 继续膨胀。
|
||||
assert.ok(part2.includes('self::migrate_ticket_tables($prefix, $charset_collate);'),
|
||||
'migrate_ticket_tables() must be called from run()');
|
||||
assert.ok(!part2.includes('aksrt_order_aftersale'), 'Part2 must not carry the old table');
|
||||
assert.ok(!part2.includes('jio_order_aftersale'), 'Part2 must not carry the old table');
|
||||
|
||||
const ticket = read('src/Core/DBMigratorTicket.php');
|
||||
for (const table of TABLES) {
|
||||
@@ -65,7 +67,7 @@ test('ticket table map exposes all six names', () => {
|
||||
const part3 = read('src/Core/DBMigratorPart3.php');
|
||||
for (const name of ['ticket', 'ticket_reply', 'ticket_status', 'ticket_type', 'ticket_prereply', 'ticket_note']) {
|
||||
assert.ok(part3.includes(`'${name}'`), `table map missing ${name}`);
|
||||
assert.ok(part3.includes(`'aksrt_${name}'`), `table map missing aksrt_${name}`);
|
||||
assert.ok(part3.includes(`'jio_${name}'`), `table map missing jio_${name}`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -120,6 +122,6 @@ test('TicketStatusService seeds mirror the migrator and guard the default row',
|
||||
assert.match(service, /if \(self::is_closed\(\$from\)\) \{\s*\n\s*return false;/);
|
||||
// 颜色只接受 #rgb / #rrggbb。
|
||||
assert.match(service, /'#6b7280'/);
|
||||
assert.match(service, /\\AKSRT\\Core\\Color::sanitize\(\$color\)/);
|
||||
assert.match(service, /\\Jio\\Core\\Color::sanitize\(\$color\)/);
|
||||
assert.doesNotMatch(service, /preg_match\('\/\^#/);
|
||||
});
|
||||
Reference in new issue
Block a user