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
@@ -32,12 +32,12 @@ test('old asset implementations and compatibility aliases are absent', () => {
|
||||
...sourceFiles(path.join(root, 'templates')),
|
||||
]
|
||||
const forbidden = [
|
||||
/aksrt_credits(?:\b|_)/,
|
||||
/['"]aksrt_balance['"]/,
|
||||
/jio_credits(?:\b|_)/,
|
||||
/['"]jio_balance['"]/,
|
||||
/\bcredit_log\b/,
|
||||
/\bbalance_log\b/,
|
||||
/aksrt_credits_(?:added|deducted)/,
|
||||
/aksrt_balance_(?:added|deducted)/,
|
||||
/jio_credits_(?:added|deducted)/,
|
||||
/jio_balance_(?:added|deducted)/,
|
||||
/credits_(?:added|deducted)/,
|
||||
// points_pass_exchange_* 现为正式设置键(卡密兑换积分功能,对齐参考主题命名),
|
||||
// 由 card-pass-modal-redeem.test.cjs 覆盖,不再作为遗留别名禁用。
|
||||
@@ -49,7 +49,7 @@ test('old asset implementations and compatibility aliases are absent', () => {
|
||||
/\brebate_log\b/,
|
||||
/\/payment\/rebate(?:\b|\/)/,
|
||||
/\bpay_rebate\b/,
|
||||
/aksrtpay_rebate_page/,
|
||||
/jiopay_rebate_page/,
|
||||
]
|
||||
const violations = []
|
||||
for (const file of files) {
|
||||
@@ -84,11 +84,11 @@ test('skeleton loading ships one contract and no dead spinner stylesheets', () =
|
||||
for (const file of css) {
|
||||
const text = fs.readFileSync(file, 'utf8')
|
||||
assert.doesNotMatch(text, /\.load-more__(?:btn|spinner)/, `${path.relative(root, file)} must not reintroduce .load-more__*`)
|
||||
assert.doesNotMatch(text, /\.aksrt-loading__(?:spinner|overlay|inline|text|dot)/, `${path.relative(root, file)} must not reintroduce .aksrt-loading__*`)
|
||||
assert.doesNotMatch(text, /aksrt-progress-bar/, `${path.relative(root, file)} must not reintroduce .aksrt-progress-bar`)
|
||||
assert.doesNotMatch(text, /\.jio-loading__(?:spinner|overlay|inline|text|dot)/, `${path.relative(root, file)} must not reintroduce .jio-loading__*`)
|
||||
assert.doesNotMatch(text, /jio-progress-bar/, `${path.relative(root, file)} must not reintroduce .jio-progress-bar`)
|
||||
// A second parallel skeleton system (never wired to any producer).
|
||||
assert.doesNotMatch(text, /\.aksrt-skeleton/, `${path.relative(root, file)} must not reintroduce .aksrt-skeleton-*`)
|
||||
assert.doesNotMatch(text, /aksrt-skeleton-shimmer/, `${path.relative(root, file)} must not reintroduce the parallel shimmer keyframes`)
|
||||
assert.doesNotMatch(text, /\.jio-skeleton/, `${path.relative(root, file)} must not reintroduce .jio-skeleton-*`)
|
||||
assert.doesNotMatch(text, /jio-skeleton-shimmer/, `${path.relative(root, file)} must not reintroduce the parallel shimmer keyframes`)
|
||||
assert.doesNotMatch(text, /--skeleton-(?:base|shine)/, `${path.relative(root, file)} must not reintroduce the unused skeleton tokens`)
|
||||
}
|
||||
})
|
||||
@@ -162,18 +162,18 @@ test('skeleton blocks share the card gutter instead of overflowing it', () => {
|
||||
// column. It must span every column and re-run the same 2-column template
|
||||
// internally while loading, so the placeholders line up with the real cards.
|
||||
const userHome = fs.readFileSync(path.join(root, 'assets/css/routes/user-home.css'), 'utf8')
|
||||
assert.match(userHome, /\.aksrt-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \.posts-item \{\s*margin-right: 0;\s*margin-left: 0;/)
|
||||
assert.match(userHome, /\.aksrt-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \{\s*grid-column: 1 \/ -1;/)
|
||||
assert.match(userHome, /\.jio-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \.posts-item \{\s*margin-right: 0;\s*margin-left: 0;/)
|
||||
assert.match(userHome, /\.jio-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \{\s*grid-column: 1 \/ -1;/)
|
||||
assert.match(
|
||||
userHome,
|
||||
/\.dashboard-panel\.is-loading \.aksrt-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \{[^}]*display: grid;[^}]*grid-template-columns: repeat\(2, minmax\(0, 1fr\)\);/s
|
||||
/\.dashboard-panel\.is-loading \.jio-user-home__post-list\[data-view="list"\] > \.post_ajax_loader \{[^}]*display: grid;[^}]*grid-template-columns: repeat\(2, minmax\(0, 1fr\)\);/s
|
||||
)
|
||||
})
|
||||
|
||||
test('asset tables are InnoDB and operation keys are unique', () => {
|
||||
const schema = fs.readFileSync(path.join(root, 'src', 'Core', 'DBMigratorPart2.php'), 'utf8')
|
||||
for (const table of ['asset_account', 'asset_transaction', 'asset_entry']) {
|
||||
assert.match(schema, new RegExp(`CREATE TABLE \\{\\$prefix\\}aksrt_${table} \\([\\s\\S]*?\\) ENGINE=InnoDB`))
|
||||
assert.match(schema, new RegExp(`CREATE TABLE \\{\\$prefix\\}jio_${table} \\([\\s\\S]*?\\) ENGINE=InnoDB`))
|
||||
}
|
||||
assert.match(schema, /UNIQUE KEY uniq_operation_key \(operation_key\)/)
|
||||
assert.match(schema, /UNIQUE KEY uniq_transaction_line \(transaction_id, line_no\)/)
|
||||
@@ -207,12 +207,12 @@ test('asset record tabs and pagination stay in the DOM without URL state', () =>
|
||||
const credits = fs.readFileSync(path.join(root, 'assets', 'js', 'credits.js'), 'utf8')
|
||||
const center = fs.readFileSync(path.join(root, 'src', 'User', 'Center.php'), 'utf8')
|
||||
|
||||
assert.match(profile, /data-aksrt-asset-tab="balance"/)
|
||||
assert.match(profile, /data-aksrt-asset-tab="points"/)
|
||||
assert.match(points, /aksrt_render_asset_pagination\([^;]+, 'points'\)/)
|
||||
assert.match(wallet, /aksrt_render_asset_pagination\([^;]+, 'balance'\)/)
|
||||
assert.match(profile, /data-jio-asset-tab="balance"/)
|
||||
assert.match(profile, /data-jio-asset-tab="points"/)
|
||||
assert.match(points, /jio_render_asset_pagination\([^;]+, 'points'\)/)
|
||||
assert.match(wallet, /jio_render_asset_pagination\([^;]+, 'balance'\)/)
|
||||
assert.doesNotMatch(profile + points + wallet, /\$_GET\[['"](?:wallet_page|credits_page)['"]\]/)
|
||||
assert.match(credits, /data-aksrt-asset-page/)
|
||||
assert.match(credits, /data-jio-asset-page/)
|
||||
assert.match(credits, /user-center\/panel\/credits\?asset=/)
|
||||
assert.match(center, /'asset'\s*=>\s*\[/)
|
||||
assert.match(center, /\$context\['asset_request'\]/)
|
||||
@@ -256,15 +256,15 @@ test('points orders bypass cash commissions and purchase dead paths stay removed
|
||||
assert.ok(pointsGuard >= 0 && affiliateGuard > pointsGuard)
|
||||
assert.match(paidMethod, /\$currency\s*=\s*sanitize_key/)
|
||||
|
||||
const pay = fs.readFileSync(path.join(root, 'inc', 'helpers', 'aksrt-pay.php'), 'utf8')
|
||||
const payTypesStart = pay.indexOf('function aksrt_get_pay_types')
|
||||
const cashMethodsStart = pay.indexOf('function aksrt_list_cash_payment_methods', payTypesStart)
|
||||
const pay = fs.readFileSync(path.join(root, 'inc', 'helpers', 'jio-pay.php'), 'utf8')
|
||||
const payTypesStart = pay.indexOf('function jio_get_pay_types')
|
||||
const cashMethodsStart = pay.indexOf('function jio_list_cash_payment_methods', payTypesStart)
|
||||
const payTypesMethod = pay.slice(payTypesStart, cashMethodsStart)
|
||||
assert.ok(payTypesStart >= 0 && cashMethodsStart > payTypesStart)
|
||||
assert.equal((payTypesMethod.match(/(?:^|\n)\s*return\b/g) || []).length, 1)
|
||||
|
||||
const cashier = fs.readFileSync(path.join(root, 'assets', 'js', 'cms-download.js'), 'utf8')
|
||||
assert.match(cashier, /\[data-action="aksrt-need-purchase"\], \[data-aksrt-pay-content\]/)
|
||||
assert.match(cashier, /\[data-action="jio-need-purchase"\], \[data-jio-pay-content\]/)
|
||||
assert.doesNotMatch(cashier, /const cashierLink\s*=\s*e\.target\.closest\('\.cashier-link'\)/)
|
||||
})
|
||||
|
||||
@@ -356,7 +356,7 @@ test('asset purchases share the order center and refresh every wallet surface',
|
||||
const chargeCard = fs.readFileSync(path.join(root, 'src', 'Payment', 'ChargeCard.php'), 'utf8')
|
||||
const creditsJs = fs.readFileSync(path.join(root, 'assets', 'js', 'credits.js'), 'utf8')
|
||||
const sidebar = fs.readFileSync(path.join(root, 'inc', 'helpers', 'user-center-renderers', 'sidebar-commerce.php'), 'utf8')
|
||||
const header = fs.readFileSync(path.join(root, 'inc', 'helpers', 'aksrt-header-userbox.php'), 'utf8')
|
||||
const header = fs.readFileSync(path.join(root, 'inc', 'helpers', 'jio-header-userbox.php'), 'utf8')
|
||||
|
||||
assert.match(domain, /ORDER_PRODUCT_POINTS\s*=\s*'points'/)
|
||||
const productTypes = ['READING', 'DOWNLOAD', 'IMAGE', 'VIDEO', 'VIP', 'RECHARGE', 'POINTS']
|
||||
@@ -370,12 +370,12 @@ test('asset purchases share the order center and refresh every wallet surface',
|
||||
statuses.map((status) => [status, status.toLowerCase()]),
|
||||
)
|
||||
assert.deepEqual(
|
||||
[...order.matchAll(/public const STATUS_([A-Z_]+)\s*=\s*\\AKSRT\\Core\\DomainModel::ORDER_STATUS_([A-Z_]+);/g)].map((match) => [match[1], match[2]]),
|
||||
[...order.matchAll(/public const STATUS_([A-Z_]+)\s*=\s*\\Jio\\Core\\DomainModel::ORDER_STATUS_([A-Z_]+);/g)].map((match) => [match[1], match[2]]),
|
||||
statuses.map((status) => [status, status]),
|
||||
)
|
||||
for (const status of statuses) {
|
||||
assert.match(domain, new RegExp(`ORDER_STATUS_${status}\\s*=\\s*'${status.toLowerCase()}'`))
|
||||
assert.match(order, new RegExp(`STATUS_${status}\\s*=\\s*\\\\AKSRT\\\\Core\\\\DomainModel::ORDER_STATUS_${status}`))
|
||||
assert.match(order, new RegExp(`STATUS_${status}\\s*=\\s*\\\\Jio\\\\Core\\\\DomainModel::ORDER_STATUS_${status}`))
|
||||
assert.match(query, new RegExp(`STATUS_${status}\\s*=\\s*'${status.toLowerCase()}'`))
|
||||
}
|
||||
for (const status of ['CREATED', 'DELIVERED', 'COMPLETED', 'PENDING_REVIEW', 'CANCELLED', 'EXPIRED']) {
|
||||
@@ -401,7 +401,7 @@ test('asset purchases share the order center and refresh every wallet surface',
|
||||
assert.match(repository, /SUM\(CASE WHEN status = 'refunding' THEN 1 ELSE 0 END\) AS paid_legacy/)
|
||||
assert.match(repository, /'paid' => \(int\) \(\$row\['paid'\] \?\? 0\) \+ \(int\) \(\$row\['paid_legacy'\] \?\? 0\)/)
|
||||
assert.doesNotMatch(repository, /\$completed_statuses|\$completed_placeholders/)
|
||||
assert.match(adminRepository, /\$valid_statuses = array_keys\(\\AKSRT\\Core\\DomainModel::order_status_labels\(\)\)/)
|
||||
assert.match(adminRepository, /\$valid_statuses = array_keys\(\\Jio\\Core\\DomainModel::order_status_labels\(\)\)/)
|
||||
assert.doesNotMatch(payOrders, /<select name="new_status">/)
|
||||
assert.doesNotMatch(`${order}\n${repository}\n${userOrders}\n${payOrders}`, /['"]force['"]\s*=>\s*true/)
|
||||
assert.match(paymentRuntime, /\$status_keys = \['pending', 'paid', 'refunded', 'closed'\]/)
|
||||
@@ -410,8 +410,8 @@ test('asset purchases share the order center and refresh every wallet surface',
|
||||
}
|
||||
assert.doesNotMatch(paymentSchema, /payment_order_status_(?:completed|cancelled|processing)/)
|
||||
|
||||
assert.match(balanceRest, /register_rest_route\('aksrt\/v1', '\/pay\/assets'/)
|
||||
assert.match(balanceRest, /'product_type'\s*=>\s*\\AKSRT\\Core\\DomainModel::ORDER_PRODUCT_POINTS/)
|
||||
assert.match(balanceRest, /register_rest_route\('jio\/v1', '\/pay\/assets'/)
|
||||
assert.match(balanceRest, /'product_type'\s*=>\s*\\Jio\\Core\\DomainModel::ORDER_PRODUCT_POINTS/)
|
||||
assert.match(balanceRest, /\$existing_order\s*=\s*\$repo->get_by_request_key\(\$operation_key\)/)
|
||||
assert.match(balanceRest, /\$order_number\s*=\s*\$repo->allocate_order_number\(\)/)
|
||||
assert.doesNotMatch(balanceRest, /['"]PX['"]\s*\.|hash\('sha256',\s*\$operation_key\)/)
|
||||
@@ -420,15 +420,15 @@ test('asset purchases share the order center and refresh every wallet surface',
|
||||
assert.match(chargeCard, /self::TYPE_CREDITS[\s\S]*?ORDER_PRODUCT_POINTS/)
|
||||
|
||||
assert.match(creditsJs, /function refreshAssetBalances\(/)
|
||||
assert.match(creditsJs, /querySelectorAll\('\[data-aksrt-wallet-value\]'/)
|
||||
assert.match(creditsJs, /querySelectorAll\('\[data-aksrt-points-value\]'/)
|
||||
assert.match(sidebar, /data-aksrt-wallet-value/)
|
||||
assert.match(sidebar, /data-aksrt-points-value/)
|
||||
assert.match(header, /data-aksrt-wallet-value/)
|
||||
assert.match(header, /data-aksrt-points-value/)
|
||||
assert.match(header, /data-aksrt-wallet-value data-aksrt-count-format="cut-count"/)
|
||||
assert.match(header, /data-aksrt-points-value data-aksrt-count-format="cut-count"/)
|
||||
assert.match(creditsJs, /element\.dataset\.aksrtCountFormat === 'cut-count' \? formatCutCount\(/)
|
||||
assert.match(creditsJs, /querySelectorAll\('\[data-jio-wallet-value\]'/)
|
||||
assert.match(creditsJs, /querySelectorAll\('\[data-jio-points-value\]'/)
|
||||
assert.match(sidebar, /data-jio-wallet-value/)
|
||||
assert.match(sidebar, /data-jio-points-value/)
|
||||
assert.match(header, /data-jio-wallet-value/)
|
||||
assert.match(header, /data-jio-points-value/)
|
||||
assert.match(header, /data-jio-wallet-value data-jio-count-format="cut-count"/)
|
||||
assert.match(header, /data-jio-points-value data-jio-count-format="cut-count"/)
|
||||
assert.match(creditsJs, /element\.dataset\.jioCountFormat === 'cut-count' \? formatCutCount\(/)
|
||||
})
|
||||
|
||||
test('header wallet count formatting matches the server cut-count thresholds', () => {
|
||||
@@ -450,9 +450,9 @@ test('recharge completion always credits the ledger and expiry SQL is strict-mod
|
||||
const charge = fs.readFileSync(path.join(root, 'src', 'Credits', 'BalanceServiceCharge.php'), 'utf8')
|
||||
const gateway = fs.readFileSync(path.join(root, 'src', 'Payment', 'Gateway.php'), 'utf8')
|
||||
|
||||
assert.match(repository, /\$new_status === \\AKSRT\\Core\\DomainModel::ORDER_STATUS_PAID/)
|
||||
assert.match(charge, /'status'\s*=>\s*\\AKSRT\\Payment\\Order::STATUS_PAID/)
|
||||
assert.match(charge, /\\AKSRT\\Payment\\Order::STATUS_PENDING,\s*\\AKSRT\\Payment\\Order::STATUS_PAID/)
|
||||
assert.match(repository, /\$new_status === \\Jio\\Core\\DomainModel::ORDER_STATUS_PAID/)
|
||||
assert.match(charge, /'status'\s*=>\s*\\Jio\\Payment\\Order::STATUS_PAID/)
|
||||
assert.match(charge, /\\Jio\\Payment\\Order::STATUS_PENDING,\s*\\Jio\\Payment\\Order::STATUS_PAID/)
|
||||
assert.doesNotMatch(charge, /Order::STATUS_(?:CREATED|COMPLETED)/)
|
||||
assert.match(gateway, /ORDER_PRODUCT_RECHARGE[\s\S]*?update_status\(\$order_number, Order::STATUS_PAID/)
|
||||
assert.doesNotMatch(repository, /expires_at\s*<>\s*''/)
|
||||
|
||||
Reference in new issue
Block a user