PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.3
Elementor Website Builder – more than just a page builder v3.30.3
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.30.3, at includes/container/container.php

55 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 class Container {
21
22 protected static $instance;
23
24 private function __construct() {}
25
26 private function __clone() {}
27
28 private static function initialize(): DIContainer {
29 if ( isset( self::$instance ) ) {
30 return self::$instance;
31 }
32
33 $builder = new ContainerBuilder();
34
35 self::register_configuration( $builder );
36 return $builder->build();
37 }
38
39 private static function register_configuration( ContainerBuilder $builder ) {
40 $builder->addDefinitions( __DIR__ . '/config.php' );
41 }
42
43 public static function initialize_instance() {
44 static::$instance = self::initialize();
45 }
46
47 public static function get_instance() {
48 if ( is_null( static::$instance ) ) {
49 self::initialize_instance();
50 }
51
52 return static::$instance;
53 }
54 }
55