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

+16 -16
View File
@@ -12,14 +12,14 @@ defined('ABSPATH') || exit;
// 数据准备
$blog_name = function_exists('aksrt_get_site_logo_text') ? aksrt_get_site_logo_text() : get_bloginfo('name');
$has_settings = class_exists('AKSRT_Settings');
$has_settings = class_exists('\AKSRT\Settings\Settings');
$search_placeholder = function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索', 'aksrt');
$search_hot_keywords = function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [];
$search_history_enabled = function_exists('aksrt_search_history_enabled') ? aksrt_search_history_enabled() : true;
$search_suggest_enabled = function_exists('aksrt_search_suggestions_enabled') ? aksrt_search_suggestions_enabled() : false;
// 联系图标 / 社交链接(legacy contacts list — fallback for more icons)
$footer_contacts = $has_settings ? AKSRT_Settings::get_footer_contacts() : [];
$footer_contacts = $has_settings ? \AKSRT\Settings\Settings::get_footer_contacts() : [];
if (empty($footer_contacts) && function_exists('aksrt_get_about_info')) {
$about = aksrt_get_about_info();
$footer_contacts = $about['contacts'] ?? [];
@@ -27,22 +27,22 @@ if (empty($footer_contacts) && function_exists('aksrt_get_about_info')) {
// 友情链接 / 快速链接(仅当 fcode_t2_code_1 为空时回退)
$friend_links = function_exists('aksrt_get_friend_links') ? aksrt_get_friend_links() : [];
$quick_links = $has_settings ? AKSRT_Settings::get_quick_links() : [];
$more_links = $has_settings ? AKSRT_Settings::get_more_links() : [];
$hot_cat_count = $has_settings ? AKSRT_Settings::get_hot_categories_count() : 0;
$quick_links = $has_settings ? \AKSRT\Settings\Settings::get_quick_links() : [];
$more_links = $has_settings ? \AKSRT\Settings\Settings::get_more_links() : [];
$hot_cat_count = $has_settings ? \AKSRT\Settings\Settings::get_hot_categories_count() : 0;
// 备案 / 版权(customize 为空时回退)
$filing = $has_settings ? AKSRT_Settings::get_filing_settings() : ['icp_enabled' => true, 'icp_number' => '', 'police_enabled' => true, 'police_number' => ''];
$filing = $has_settings ? \AKSRT\Settings\Settings::get_filing_settings() : ['icp_enabled' => true, 'icp_number' => '', 'police_enabled' => true, 'police_number' => ''];
$icp_number = !empty($filing['icp_enabled']) ? (string) ($filing['icp_number'] ?? '') : '';
$police_number = !empty($filing['police_enabled']) ? (string) ($filing['police_number'] ?? '') : '';
$footer_text = $has_settings ? AKSRT_Settings::footer_text() : '';
$copyright_text = $has_settings ? AKSRT_Settings::get_copyright_text() : '';
$footer_text = $has_settings ? \AKSRT\Settings\Settings::footer_text() : '';
$copyright_text = $has_settings ? \AKSRT\Settings\Settings::get_copyright_text() : '';
// §2.3 三列结构化字段(Zibll keys)
$footer_brand = $has_settings ? AKSRT_Settings::get_footer_brand_settings() : ['m_s' => ['pc', 'mobile'], 'img' => '', 'img_dark' => '', 'title' => '', 'custom_code' => ''];
$footer_contact_ext = $has_settings ? AKSRT_Settings::get_footer_contact_extended_settings() : ['m_s' => ['pc', 'mobile'], 'wechat_img' => '', 'qq' => '', 'weibo' => '', 'email' => '', 'more' => [], 'code_1' => '', 'code_2' => ''];
$footer_mini = $has_settings ? AKSRT_Settings::get_footer_mini_img_settings() : ['m_s' => ['pc', 'mobile'], 'items' => []];
$footer_customize_code = $has_settings ? AKSRT_Settings::get_footer_customize_code() : '';
$footer_brand = $has_settings ? \AKSRT\Settings\Settings::get_footer_brand_settings() : ['m_s' => ['pc', 'mobile'], 'img' => '', 'img_dark' => '', 'title' => '', 'custom_code' => ''];
$footer_contact_ext = $has_settings ? \AKSRT\Settings\Settings::get_footer_contact_extended_settings() : ['m_s' => ['pc', 'mobile'], 'wechat_img' => '', 'qq' => '', 'weibo' => '', 'email' => '', 'more' => [], 'code_1' => '', 'code_2' => ''];
$footer_mini = $has_settings ? \AKSRT\Settings\Settings::get_footer_mini_img_settings() : ['m_s' => ['pc', 'mobile'], 'items' => []];
$footer_customize_code = $has_settings ? \AKSRT\Settings\Settings::get_footer_customize_code() : '';
// 设备可见性 → Zibll hidden-xs(仅在不含 mobile 时隐藏移动端)
$_brand_show_sm = in_array('mobile', (array) ($footer_brand['m_s'] ?? []), true);
@@ -324,11 +324,11 @@ if ($_footer_conter === '') {
<!-- 浮动右侧按钮组 -->
<?php
$floating_settings = $has_settings ? AKSRT_Settings::get_floating_buttons_settings() : [];
$floating_items = $has_settings ? AKSRT_Settings::get_floating_buttons_items() : [];
$floating_settings = $has_settings ? \AKSRT\Settings\Settings::get_floating_buttons_settings() : [];
$floating_items = $has_settings ? \AKSRT\Settings\Settings::get_floating_buttons_items() : [];
$floating_enabled = !empty($floating_settings['enabled']) && !empty($floating_items);
$tabbar_settings = $has_settings ? AKSRT_Settings::get_footer_tabbar_settings() : [];
$tabbar_items = $has_settings ? AKSRT_Settings::get_footer_tabbar_items() : [];
$tabbar_settings = $has_settings ? \AKSRT\Settings\Settings::get_footer_tabbar_settings() : [];
$tabbar_items = $has_settings ? \AKSRT\Settings\Settings::get_footer_tabbar_items() : [];
$tabbar_enabled = !empty($tabbar_settings['enabled']) && !empty($tabbar_items);
$floating_classes = 'float-right';
$floating_classes .= ' ' . (!empty($floating_settings['style']) ? sanitize_html_class($floating_settings['style']) : 'round');