PluginProbe ʕ •ᴥ•ʔ
Hostinger Tools / 3.0.72
Hostinger Tools v3.0.72
3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 3.0.0 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.17 3.0.18 3.0.19 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.59 3.0.6 3.0.60 3.0.61 3.0.62 3.0.65 3.0.7 3.0.8 3.0.9 trunk 1.8.0
hostinger / vendor / jetpack-autoloader / class-container.php
hostinger / vendor / jetpack-autoloader Last commit date
class-autoloader-handler.php 1 week ago class-autoloader-locator.php 1 week ago class-autoloader.php 1 week ago class-container.php 1 week ago class-hook-manager.php 1 week ago class-latest-autoloader-guard.php 1 week ago class-manifest-reader.php 1 week ago class-path-processor.php 1 week ago class-php-autoloader.php 1 week ago class-plugin-locator.php 1 week ago class-plugins-handler.php 1 week ago class-shutdown-handler.php 1 week ago class-version-loader.php 1 week ago class-version-selector.php 1 week ago
class-container.php
151 lines
1 <?php
2 /**
3 * This file was automatically generated by automattic/jetpack-autoloader.
4 *
5 * @package automattic/jetpack-autoloader
6 */
7
8 namespace Automattic\Jetpack\Autoloader\jpdbd67c2d973de5f4c78a03e582c78768\al5_0_20;
9
10 // phpcs:ignore
11
12 /**
13 * This class manages the files and dependencies of the autoloader.
14 */
15 class Container {
16
17 /**
18 * Since each autoloader's class files exist within their own namespace we need a map to
19 * convert between the local class and a shared key. Note that no version checking is
20 * performed on these dependencies and the first autoloader to register will be the
21 * one that is utilized.
22 */
23 const SHARED_DEPENDENCY_KEYS = array(
24 Hook_Manager::class => 'Hook_Manager',
25 );
26
27 /**
28 * A map of all the dependencies we've registered with the container and created.
29 *
30 * @var array
31 */
32 protected $dependencies;
33
34 /**
35 * The constructor.
36 */
37 public function __construct() {
38 $this->dependencies = array();
39
40 $this->register_shared_dependencies();
41 $this->register_dependencies();
42 $this->initialize_globals();
43 }
44
45 /**
46 * Gets a dependency out of the container.
47 *
48 * @param string $class The class to fetch.
49 *
50 * @return mixed
51 * @throws \InvalidArgumentException When a class that isn't registered with the container is fetched.
52 */
53 public function get( $class ) {
54 if ( ! isset( $this->dependencies[ $class ] ) ) {
55 throw new \InvalidArgumentException( "Class '$class' is not registered with the container." );
56 }
57
58 return $this->dependencies[ $class ];
59 }
60
61 /**
62 * Registers all of the dependencies that are shared between all instances of the autoloader.
63 */
64 private function register_shared_dependencies() {
65 global $jetpack_autoloader_container_shared;
66 if ( ! isset( $jetpack_autoloader_container_shared ) ) {
67 $jetpack_autoloader_container_shared = array();
68 }
69
70 $key = self::SHARED_DEPENDENCY_KEYS[ Hook_Manager::class ];
71 if ( ! isset( $jetpack_autoloader_container_shared[ $key ] ) ) {
72 require_once __DIR__ . '/class-hook-manager.php';
73 $jetpack_autoloader_container_shared[ $key ] = new Hook_Manager();
74 }
75 $this->dependencies[ Hook_Manager::class ] = &$jetpack_autoloader_container_shared[ $key ];
76 }
77
78 /**
79 * Registers all of the dependencies with the container.
80 */
81 private function register_dependencies() {
82 require_once __DIR__ . '/class-path-processor.php';
83 $this->dependencies[ Path_Processor::class ] = new Path_Processor();
84
85 require_once __DIR__ . '/class-plugin-locator.php';
86 $this->dependencies[ Plugin_Locator::class ] = new Plugin_Locator(
87 $this->get( Path_Processor::class )
88 );
89
90 require_once __DIR__ . '/class-version-selector.php';
91 $this->dependencies[ Version_Selector::class ] = new Version_Selector();
92
93 require_once __DIR__ . '/class-autoloader-locator.php';
94 $this->dependencies[ Autoloader_Locator::class ] = new Autoloader_Locator(
95 $this->get( Version_Selector::class )
96 );
97
98 require_once __DIR__ . '/class-php-autoloader.php';
99 $this->dependencies[ PHP_Autoloader::class ] = new PHP_Autoloader();
100
101 require_once __DIR__ . '/class-manifest-reader.php';
102 $this->dependencies[ Manifest_Reader::class ] = new Manifest_Reader(
103 $this->get( Version_Selector::class )
104 );
105
106 require_once __DIR__ . '/class-plugins-handler.php';
107 $this->dependencies[ Plugins_Handler::class ] = new Plugins_Handler(
108 $this->get( Plugin_Locator::class ),
109 $this->get( Path_Processor::class )
110 );
111
112 require_once __DIR__ . '/class-autoloader-handler.php';
113 $this->dependencies[ Autoloader_Handler::class ] = new Autoloader_Handler(
114 $this->get( PHP_Autoloader::class ),
115 $this->get( Hook_Manager::class ),
116 $this->get( Manifest_Reader::class ),
117 $this->get( Version_Selector::class )
118 );
119
120 require_once __DIR__ . '/class-latest-autoloader-guard.php';
121 $this->dependencies[ Latest_Autoloader_Guard::class ] = new Latest_Autoloader_Guard(
122 $this->get( Plugins_Handler::class ),
123 $this->get( Autoloader_Handler::class ),
124 $this->get( Autoloader_Locator::class )
125 );
126
127 // Register any classes that we will use elsewhere.
128 require_once __DIR__ . '/class-version-loader.php';
129 require_once __DIR__ . '/class-shutdown-handler.php';
130 }
131
132 /**
133 * Initializes any of the globals needed by the autoloader.
134 */
135 private function initialize_globals() {
136 /*
137 * This global was retired in version 2.9. The value is set to 'false' to maintain
138 * compatibility with older versions of the autoloader.
139 */
140 global $jetpack_autoloader_including_latest;
141 $jetpack_autoloader_including_latest = false;
142
143 // Not all plugins can be found using the locator. In cases where a plugin loads the autoloader
144 // but was not discoverable, we will record them in this array to track them as "active".
145 global $jetpack_autoloader_activating_plugins_paths;
146 if ( ! isset( $jetpack_autoloader_activating_plugins_paths ) ) {
147 $jetpack_autoloader_activating_plugins_paths = array();
148 }
149 }
150 }
151