refactor(autoload): migrate theme classes to Composer PSR-4

Move 288 types from global AKSRT_* + inc/classes manual requires into
namespace AKSRT\{Domain} under src/AKSRT/, wire composer.json psr-4,
and slim bootstrap to helpers/modules/hooks only. Split multi-class
widget/gateway files, update admin contract audit paths, and document
the layout in ADR/README.
This commit is contained in:
kate522 committed 2026-07-17 13:29:22 +08:00
1 parent 8f349b40fb
commit aaf458af1c
404 files changed
+13602 -7705

No files matched your search

@@ -44,7 +44,7 @@ if (!empty($show_vip)) {
if ($show_credits) {
require $dir . '/credits-signin.php';
}
if (class_exists('AKSRT_User_Level')) {
if (class_exists('\AKSRT\User\Level')) {
require $dir . '/credits-level.php';
}
@@ -54,7 +54,7 @@ if ($show_wallet || $show_credits) :
if ($active_record === '' || !in_array($active_record, ['balance', 'points', 'points_free', 'points_date'], true)) {
$active_record = $show_wallet ? 'balance' : 'points';
}
$show_tasks = $show_credits && class_exists('AKSRT_Points_Free') && AKSRT_Points_Free::enabled();
$show_tasks = $show_credits && class_exists('\AKSRT\Credits\PointsFree') && \AKSRT\Credits\PointsFree::enabled();
?>
<div class="uc-asset-tabs zib-widget">
<ul class="uc-asset-tabs__nav list-inline tab-nav-theme font-bold">
@@ -82,8 +82,8 @@ if ($show_wallet || $show_credits) :
// Render only the ledger portion by reusing balance log markup.
$user_id = (int) ($user_id ?? 0);
$wallet_page = max(1, isset($_GET['wallet_page']) ? (int) $_GET['wallet_page'] : 1);
$wlog = class_exists('AKSRT_Balance')
? AKSRT_Balance::get_log(['user_id' => $user_id, 'page' => $wallet_page, 'per_page' => 10])
$wlog = class_exists('\AKSRT\Credits\Balance')
? \AKSRT\Credits\Balance::get_log(['user_id' => $user_id, 'page' => $wallet_page, 'per_page' => 10])
: ['items' => [], 'total' => 0];
?>
<div class="uc-transactions uc-transactions--wallet">
@@ -92,7 +92,7 @@ if ($show_wallet || $show_credits) :
<?php foreach ($wlog['items'] as $row) :
$delta = (float) $row['delta'];
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('AKSRT_Balance') ? AKSRT_Balance::format($delta) : number_format_i18n($delta, 2));
$delta_txt = ($delta > 0 ? '+' : '') . (class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format($delta) : number_format_i18n($delta, 2));
?>
<div class="uc-transactions__item">
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
@@ -100,7 +100,7 @@ if ($show_wallet || $show_credits) :
</div>
<div class="uc-transactions__info">
<div class="uc-transactions__reason">
<?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
<?php echo esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::reason_label((string) $row['reason']) : (string) $row['reason']); ?>
<?php if (!empty($row['remark'])) : ?>
<span class="uc-transactions__remark">(<?php echo esc_html((string) $row['remark']); ?>)</span>
<?php endif; ?>
@@ -109,7 +109,7 @@ if ($show_wallet || $show_credits) :
</div>
<div class="uc-transactions__amount">
<span class="uc-transactions__delta <?php echo esc_attr($delta_class); ?>"><?php echo esc_html($delta_txt); ?></span>
<span class="uc-transactions__balance"><?php printf(esc_html__('余额 %s', 'aksrt'), esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format((float) ($row['balance_after'] ?? 0)) : number_format_i18n((float) ($row['balance_after'] ?? 0), 2))); ?></span>
<span class="uc-transactions__balance"><?php printf(esc_html__('余额 %s', 'aksrt'), esc_html(class_exists('\AKSRT\Credits\Balance') ? \AKSRT\Credits\Balance::format((float) ($row['balance_after'] ?? 0)) : number_format_i18n((float) ($row['balance_after'] ?? 0), 2))); ?></span>
<?php if (!empty($row['ref_id'])) : ?>
<span class="uc-transactions__ref muted-2-color em09"><?php printf(esc_html__('单号 %s', 'aksrt'), esc_html((string) $row['ref_id'])); ?></span>
<?php endif; ?>