PluginProbe
Elementor Website Builder – more than just a page builder / 3.25.8
Elementor Website Builder – more than just a page builder v3.25.8
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / container / container.php

container.php in Elementor Website Builder – more than just a page builder 3.25.8, at includes/container/container.php

56 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Container;
4
5 use ElementorDeps\DI\ContainerBuilder;
6 use ElementorDeps\DI\Container as DIContainer;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 /**
13 * Elementor Container.
14 *
15 * Elementor container handler class is responsible for the containerization
16 * of manager classes and their dependencies.
17 *
18 * @since 3.24.0
19 */
20
21 class Container {
22
23 protected static $instance;
24
25 private function __construct() {}
26
27 private function __clone() {}
28
29 private static function initialize(): DIContainer {
30 if ( isset( self::$instance ) ) {
31 return self::$instance;
32 }
33
34 $builder = new ContainerBuilder();
35
36 self::register_configuration( $builder );
37 return $builder->build();
38 }
39
40 private static function register_configuration( ContainerBuilder $builder ) {
41 $builder->addDefinitions( __DIR__ . '/config.php' );
42 }
43
44 public static function initialize_instance() {
45 static::$instance = self::initialize();
46 }
47
48 public static function get_instance() {
49 if ( is_null( static::$instance ) ) {
50 self::initialize_instance();
51 }
52
53 return static::$instance;
54 }
55 }
56