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:
2026-07-17 13:29:22 +08:00
parent 8f349b40fb
commit aaf458af1c
404 changed files with 13602 additions and 7705 deletions
+10 -10
View File
@@ -24,8 +24,8 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
: [];
$is_own_profile = !empty($dashboard['is_own_profile']);
$user_home_settings = class_exists('AKSRT_Settings')
? AKSRT_Settings::get_user_home_settings()
$user_home_settings = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_user_home_settings()
: [
'tabs' => ['posts', 'favorites', 'comments', 'follow'],
'sidebar' => false,
@@ -34,8 +34,8 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
'posts_per_page' => 10,
];
$user_center_settings = class_exists('AKSRT_Settings')
? AKSRT_Settings::get_user_center_settings()
$user_center_settings = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_user_center_settings()
: ['social_links' => true];
$post_count = (int) ($dashboard['post_count'] ?? 0);
@@ -48,7 +48,7 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
$credit_balance = $dashboard['credit_balance'] ?? 0.0;
$currency_name = $dashboard['currency_name'] ?? __('积分', 'aksrt');
$user_home_manager = class_exists('AKSRT_User_Home') ? AKSRT_User_Home::get_instance() : null;
$user_home_manager = class_exists('\AKSRT\User\Home') ? \AKSRT\User\Home::get_instance() : null;
$visible_tabs = $user_home_manager ? $user_home_manager->get_visible_tabs($is_own_profile) : [];
$enabled_tabs = array_keys($visible_tabs);
@@ -79,17 +79,17 @@ if (!function_exists('aksrt_get_user_home_page_context')) {
$display_tabs = $is_mobile ? $enabled_tabs_mobile : $enabled_tabs_pc;
$default_tab = !empty($display_tabs) ? $display_tabs[0] : $enabled_tabs[0];
$forum_instance = class_exists('AKSRT_Forum') ? AKSRT_Forum::get_instance() : null;
$forum_instance = class_exists('\AKSRT\Forum\Forum') ? \AKSRT\Forum\Forum::get_instance() : null;
$forum_stats = $forum_instance ? $forum_instance->get_user_forum_stats($user_id) : [];
$forum_topic_count = (int) ($forum_stats['topic_count'] ?? 0);
$product_count = 0;
if (class_exists('AKSRT_Shop')) {
$product_count = (int) AKSRT_Shop::get_instance()->count_author_products($user_id);
if (class_exists('\AKSRT\Shop\Shop')) {
$product_count = (int) \AKSRT\Shop\Shop::get_instance()->count_author_products($user_id);
}
$follow_count = 0;
if (class_exists('AKSRT_Follow')) {
$follow_count = (int) AKSRT_Follow::get_instance()->get_follower_count($user_id);
if (class_exists('\AKSRT\User\Follow')) {
$follow_count = (int) \AKSRT\User\Follow::get_instance()->get_follower_count($user_id);
}
$plate_count = 0;