Plugin Directory

Changeset 3423229


Ignore:
Timestamp:
12/18/2025 08:33:41 PM (4 months ago)
Author:
pushrelay
Message:

Fix fatal error by loading required class files explicitly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pushrelay/trunk/includes/Core/Plugin.php

    r3423220 r3423229  
    11<?php
    22namespace PushRelay\Core;
    3 
    4 use PushRelay\Utils\Health;
    5 use PushRelay\Push\Worker;
    63
    74if ( ! defined( 'ABSPATH' ) ) {
     
    96}
    107
     8/**
     9 * Core plugin bootstrap.
     10 */
    1111final class Plugin {
    1212
    13     private static ?self $instance = null;
     13    private static $instance = null;
    1414
    1515    public static function instance(): self {
     
    1717            self::$instance = new self();
    1818        }
    19 
    2019        return self::$instance;
    2120    }
    2221
    2322    private function __construct() {
     23        $this->load_dependencies();
    2424        $this->load_textdomain();
    2525        $this->init_health();
    2626        $this->init_worker();
     27    }
     28
     29    /**
     30     * Manually load required class files.
     31     */
     32    private function load_dependencies(): void {
     33        require_once PUSHRELAY_PLUGIN_DIR . 'includes/Utils/Health.php';
     34        require_once PUSHRELAY_PLUGIN_DIR . 'includes/Push/Worker.php';
    2735    }
    2836
     
    3644
    3745    private function init_health(): void {
    38         Health::init();
     46        \PushRelay\Utils\Health::init();
    3947    }
    4048
    4149    private function init_worker(): void {
    42         Worker::init();
     50        \PushRelay\Push\Worker::init();
    4351    }
    4452}
Note: See TracChangeset for help on using the changeset viewer.