Plugin Directory


Ignore:
Timestamp:
04/28/2025 08:21:10 AM (7 months ago)
Author:
iqbalrony
Message:

Release version 3.16.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • happy-elementor-addons/trunk/base.php

    r3237854 r3283199  
    2323        }
    2424        return self::$instance;
     25    }
     26
     27    private function __construct() {
     28        $this->run_autoload();
    2529    }
    2630
     
    104108        include_once( HAPPY_ADDONS_DIR_PATH . 'classes/conditions-cache.php' );
    105109        include_once( HAPPY_ADDONS_DIR_PATH . 'classes/theme-builder.php' );
    106         include_once( HAPPY_ADDONS_DIR_PATH . 'classes/condition-manager.php' );
     110        // include_once( HAPPY_ADDONS_DIR_PATH . 'classes/condition-manager.php' );
    107111
    108112        include_once( HAPPY_ADDONS_DIR_PATH . 'classes/builder-compatibility/astra.php');
     
    117121
    118122    public function include_on_init() {
     123        Condition_Manager::instance();
    119124        include_once( HAPPY_ADDONS_DIR_PATH . 'classes/extensions-manager.php' );
    120125        include_once( HAPPY_ADDONS_DIR_PATH . 'classes/credentials-manager.php' );
     
    159164        $controls_Manager->add_group_control( $Text_Stroke::get_type(), new $Text_Stroke() );
    160165    }
     166
     167    protected function autoload( $class_name ) {
     168        if ( 0 !== strpos( $class_name, __NAMESPACE__ ) ) {
     169            return;
     170        }
     171
     172        if( 'Happy_Addons\Elementor\Condition_Manager' == $class_name ) {
     173            $file_name = strtolower(
     174                str_replace(
     175                    [ __NAMESPACE__ . '\\', '_', '\\' ], // replace namespace, underscrore & backslash
     176                    [ '', '-', '/' ],
     177                    $class_name
     178                )
     179            );
     180            $file = HAPPY_ADDONS_DIR_PATH . 'classes/' . $file_name . '.php';
     181            if ( ! class_exists( $class_name ) && is_readable( $file ) ) {
     182                include_once $file;
     183            }
     184        }
     185    }
     186
     187    public function run_autoload() {
     188        spl_autoload_register( [ $this, 'autoload' ] );
     189    }
    161190}
Note: See TracChangeset for help on using the changeset viewer.