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:
1 parent
8f349b40fb
commit
aaf458af1c
404 files changed
+13602
-7705
No files matched your search
@@ -41,12 +41,12 @@ $gate_blocked = is_wp_error($gate);
|
||||
$gate_code = $gate_blocked ? $gate->get_error_code() : '';
|
||||
$gate_data = $gate_blocked ? (array) $gate->get_error_data() : [];
|
||||
|
||||
$paid_settings = class_exists('AKSRT_Settings')
|
||||
? AKSRT_Settings::get_paid_content_settings()
|
||||
$paid_settings = class_exists('\AKSRT\Settings\Settings')
|
||||
? \AKSRT\Settings\Settings::get_paid_content_settings()
|
||||
: ['download_credit' => true, 'download_captcha' => false];
|
||||
|
||||
$access = class_exists('AKSRT_Content_Visibility')
|
||||
? AKSRT_Content_Visibility::get_post_access_state($post_id)
|
||||
$access = class_exists('\AKSRT\Content\Visibility')
|
||||
? \AKSRT\Content\Visibility::get_post_access_state($post_id)
|
||||
: [];
|
||||
$has_paid_access = !empty($access['has_paid_access']);
|
||||
$priced = function_exists('aksrt_get_user_pay_price') ? aksrt_get_user_pay_price($post_id) : null;
|
||||
@@ -60,7 +60,7 @@ $captcha_active = !empty($paid_settings['download_captcha']) || !empty($meta['re
|
||||
if ($captcha_active && function_exists('aksrt_is_captcha_enabled_for') && !aksrt_is_captcha_enabled_for('download')) {
|
||||
$captcha_active = false;
|
||||
}
|
||||
$balance = (int) ($gate_data['balance'] ?? (is_user_logged_in() && class_exists('AKSRT_Credits') ? AKSRT_Credits::balance(get_current_user_id()) : 0));
|
||||
$balance = (int) ($gate_data['balance'] ?? (is_user_logged_in() && class_exists('\AKSRT\Credits\Credits') ? \AKSRT\Credits\Credits::balance(get_current_user_id()) : 0));
|
||||
$login_url = (string) ($gate_data['login_url'] ?? wp_login_url(get_permalink($post_id)));
|
||||
$vip_url = function_exists('aksrt_get_user_center_tab_url')
|
||||
? aksrt_get_user_center_tab_url('credits')
|
||||
@@ -134,10 +134,10 @@ $show_sales = !isset($meta['show_sales']) || !empty($meta['show_sales']);
|
||||
$pay_type_badge = function_exists('aksrt_get_pay_type_badge') ? aksrt_get_pay_type_badge($pay_type) : '';
|
||||
|
||||
// 货币名称
|
||||
$currency = class_exists('AKSRT_Settings') ? AKSRT_Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
$currency = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_currency_name() : __('积分', 'aksrt');
|
||||
$cash_symbol = '¥';
|
||||
if (class_exists('AKSRT_Settings')) {
|
||||
$paid_display = AKSRT_Settings::get_paid_content_settings();
|
||||
if (class_exists('\AKSRT\Settings\Settings')) {
|
||||
$paid_display = \AKSRT\Settings\Settings::get_paid_content_settings();
|
||||
$cash_symbol = (string) ($paid_display['display']['currency_symbol'] ?? '¥');
|
||||
}
|
||||
$format_vip = static function (float $amount) use ($pay_modo, $currency, $cash_symbol): string {
|
||||
|
||||
Reference in new issue
Block a user