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

+9 -9
View File
@@ -15,7 +15,7 @@ $per_page = 12;
$type_filter = isset($_GET['resource_type']) ? sanitize_key((string) $_GET['resource_type']) : '';
$resource_type_labels = function_exists('aksrt_get_pay_types') ? aksrt_get_pay_types() : [];
unset($resource_type_labels[AKSRT_Domain_Model::PAY_TYPE_READING]);
unset($resource_type_labels[\AKSRT\Core\DomainModel::PAY_TYPE_READING]);
if ($type_filter !== '' && !isset($resource_type_labels[$type_filter])) {
$type_filter = '';
@@ -31,8 +31,8 @@ $query_args = [
'ignore_sticky_posts' => true,
'meta_query' => [
[
'key' => AKSRT_Domain_Model::PAY_TYPE_KEY,
'value' => AKSRT_Domain_Model::PAY_TYPE_DOWNLOAD,
'key' => \AKSRT\Core\DomainModel::PAY_TYPE_KEY,
'value' => \AKSRT\Core\DomainModel::PAY_TYPE_DOWNLOAD,
'compare' => '=',
],
],
@@ -40,7 +40,7 @@ $query_args = [
if ($type_filter !== '') {
$query_args['meta_query'][] = [
'key' => AKSRT_Domain_Model::PAY_TYPE_KEY,
'key' => \AKSRT\Core\DomainModel::PAY_TYPE_KEY,
'value' => $type_filter,
];
}
@@ -52,15 +52,15 @@ $user_credits = 0;
$user_download_count = 0;
if ($is_logged_in) {
$uid = get_current_user_id();
if (class_exists('AKSRT_Credits')) {
$user_credits = AKSRT_Credits::balance($uid);
if (class_exists('\AKSRT\Credits\Credits')) {
$user_credits = \AKSRT\Credits\Credits::balance($uid);
}
$dl_meta = get_user_meta($uid, '_aksrt_downloaded_resources', true);
$user_download_count = is_array($dl_meta) ? count($dl_meta) : 0;
}
$currency_name = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_currency_name() : __('积分', 'aksrt');
$paid_settings = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_paid_content_settings() : [];
$currency_name = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
$paid_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_paid_content_settings() : [];
$dl_requires_login = !empty($paid_settings['download_login']);
?>
@@ -139,7 +139,7 @@ $dl_requires_login = !empty($paid_settings['download_login']);
<?php echo esc_html(get_the_date()); ?>
</span>
<?php
$dl_count = (int) get_post_meta(get_the_ID(), AKSRT_Domain_Model::RESOURCE_DOWNLOAD_COUNT_KEY, true);
$dl_count = (int) get_post_meta(get_the_ID(), \AKSRT\Core\DomainModel::RESOURCE_DOWNLOAD_COUNT_KEY, true);
if ($dl_count > 0) :
?>
<span class="aksrt-download-card__downloads">