mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-03 11:11:30 +08:00
Added new service classes: Maintenance, Acceleration, Adblock, Avatar, Database, Fonts, Performance, and related templates and assets. Updated Service/Base.php to conditionally instantiate service classes only if they exist. Improved Service/Memory.php and Service/Monitor.php with better settings handling and update logic. Enhanced Service/Setting.php to simplify framework title usage. These changes modularize features and improve plugin extensibility and reliability.
48 lines
1.1 KiB
PHP
Executable file
48 lines
1.1 KiB
PHP
Executable file
<?php
|
|
|
|
namespace WenPai\ChinaYes\Service;
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
/**
|
|
* Class Base
|
|
* 插件主服务
|
|
* @package WenPai\ChinaYes\Service
|
|
*/
|
|
class Base {
|
|
|
|
public function __construct() {
|
|
// 确保所有类文件都存在后再实例化
|
|
if (class_exists(__NAMESPACE__ . '\Super')) {
|
|
new Super();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Monitor')) {
|
|
new Monitor();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Memory')) {
|
|
new Memory();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Update')) {
|
|
new Update();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Database')) {
|
|
new Database();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Acceleration')) {
|
|
new Acceleration();
|
|
}
|
|
|
|
if (class_exists(__NAMESPACE__ . '\Maintenance')) {
|
|
new Maintenance();
|
|
}
|
|
|
|
if ( is_admin() && class_exists(__NAMESPACE__ . '\Setting')) {
|
|
new Setting();
|
|
}
|
|
}
|
|
}
|