Files
kate522andClaude Opus 5 35bb96e82f 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>
2026-11-01 20:05:04 +08:00

77 lines
2.2 KiB
PHP

<?php
/**
* PSR-4 path audit — every symbol under src/ must sit at the path Composer maps.
*
* Catches the fatal "Trait ... not found" class of bug: a trait (or class) nested
* in a `*-traits/` subdirectory is invisible to PSR-4, which resolves by
* namespace alone and never scans subdirectories. src/ classes load via
* `Jio\ => src/` (composer.json) — no bootstrap require list — so a misplaced
* file loads nowhere and fatals the moment its host class compiles.
*
* Usage (from theme root):
* php tools/audit-psr4-paths.php
*
* Exit 1 on hard errors.
*/
declare(strict_types=1);
$themeRoot = dirname(__DIR__);
$srcRoot = $themeRoot . '/src';
$prefix = 'Jio';
$rii = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($srcRoot, FilesystemIterator::SKIP_DOTS)
);
$files = [];
foreach ($rii as $file) {
if ($file->isFile() && strtolower($file->getExtension()) === 'php') {
$files[] = $file->getPathname();
}
}
sort($files);
$problems = [];
foreach ($files as $path) {
$src = (string) file_get_contents($path);
if (!preg_match('/^\s*namespace\s+([^;]+);/m', $src, $nsMatch)) {
continue;
}
$namespace = trim($nsMatch[1]);
if (!str_starts_with($namespace, $prefix . '\\')) {
continue;
}
if (!preg_match('/^\s*(?:final\s+|abstract\s+|readonly\s+)*(?:class|interface|trait|enum)\s+(\w+)/m', $src, $symMatch)) {
continue;
}
$symbol = $symMatch[1];
$relative = str_replace('\\', '/', substr($namespace, strlen($prefix)));
$expected = str_replace('//', '/', $srcRoot . $relative . '/' . $symbol . '.php');
if (realpath($expected) !== realpath($path)) {
$problems[] = sprintf(
"%s declares %s\\%s -> expected %s",
str_replace('\\', '/', substr($path, strlen($srcRoot) + 1)),
$namespace,
$symbol,
str_replace('\\', '/', substr($expected, strlen($srcRoot) + 1))
);
}
}
foreach ($problems as $problem) {
fwrite(STDERR, '[error] ' . $problem . PHP_EOL);
}
fwrite(STDERR, sprintf(
'scanned=%d errors=%d%s',
count($files),
count($problems),
PHP_EOL
));
exit($problems === [] ? 0 : 1);