Completed
Branch BUG/chicken-is-a-required-ques... (f96ad9)
by
unknown
42:30 queued 28:14
created
core/EE_Front_Controller.core.php 1 patch
Indentation   +470 added lines, -470 removed lines patch added patch discarded remove patch
@@ -26,474 +26,474 @@
 block discarded – undo
26 26
 final class EE_Front_Controller
27 27
 {
28 28
 
29
-    /**
30
-     * @var string $_template_path
31
-     */
32
-    private $_template_path;
33
-
34
-    /**
35
-     * @var string $_template
36
-     */
37
-    private $_template;
38
-
39
-    /**
40
-     * @type EE_Registry $Registry
41
-     */
42
-    protected $Registry;
43
-
44
-    /**
45
-     * @type EE_Request_Handler $Request_Handler
46
-     */
47
-    protected $Request_Handler;
48
-
49
-    /**
50
-     * @type EE_Module_Request_Router $Module_Request_Router
51
-     */
52
-    protected $Module_Request_Router;
53
-
54
-
55
-    /**
56
-     *    class constructor
57
-     *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
-     *
59
-     * @access    public
60
-     * @param \EE_Registry              $Registry
61
-     * @param \EE_Request_Handler       $Request_Handler
62
-     * @param \EE_Module_Request_Router $Module_Request_Router
63
-     */
64
-    public function __construct(
65
-        EE_Registry $Registry,
66
-        EE_Request_Handler $Request_Handler,
67
-        EE_Module_Request_Router $Module_Request_Router
68
-    ) {
69
-        $this->Registry = $Registry;
70
-        $this->Request_Handler = $Request_Handler;
71
-        $this->Module_Request_Router = $Module_Request_Router;
72
-        // determine how to integrate WP_Query with the EE models
73
-        add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
74
-        // load other resources and begin to actually run shortcodes and modules
75
-        add_action('wp_loaded', array($this, 'wp_loaded'), 5);
76
-        // analyse the incoming WP request
77
-        add_action('parse_request', array($this, 'get_request'), 1, 1);
78
-        // process request with module factory
79
-        add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
80
-        // before headers sent
81
-        add_action('wp', array($this, 'wp'), 5);
82
-        // primarily used to process any content shortcodes
83
-        add_action('template_redirect', array($this, 'templateRedirect'), 999);
84
-        // header
85
-        add_action('wp_head', array($this, 'header_meta_tag'), 5);
86
-        add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
87
-        add_filter('template_include', array($this, 'template_include'), 1);
88
-        // display errors
89
-        add_action('loop_start', array($this, 'display_errors'), 2);
90
-        // the content
91
-        // add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
92
-        // exclude our private cpt comments
93
-        add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
94
-        // make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
95
-        add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
96
-        // action hook EE
97
-        do_action('AHEE__EE_Front_Controller__construct__done', $this);
98
-    }
99
-
100
-
101
-    /**
102
-     * @return EE_Request_Handler
103
-     */
104
-    public function Request_Handler()
105
-    {
106
-        return $this->Request_Handler;
107
-    }
108
-
109
-
110
-    /**
111
-     * @return EE_Module_Request_Router
112
-     */
113
-    public function Module_Request_Router()
114
-    {
115
-        return $this->Module_Request_Router;
116
-    }
117
-
118
-
119
-    /**
120
-     * @return LegacyShortcodesManager
121
-     */
122
-    public function getLegacyShortcodesManager()
123
-    {
124
-        return EE_Config::getLegacyShortcodesManager();
125
-    }
126
-
127
-
128
-
129
-
130
-
131
-    /***********************************************        INIT ACTION HOOK         ***********************************************/
132
-    /**
133
-     * filter_wp_comments
134
-     * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
135
-     * widgets/queries done on frontend
136
-     *
137
-     * @param  array $clauses array of comment clauses setup by WP_Comment_Query
138
-     * @return array array of comment clauses with modifications.
139
-     * @throws InvalidArgumentException
140
-     * @throws InvalidDataTypeException
141
-     * @throws InvalidInterfaceException
142
-     */
143
-    public function filter_wp_comments($clauses)
144
-    {
145
-        global $wpdb;
146
-        if (strpos($clauses['join'], $wpdb->posts) !== false) {
147
-            /** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
148
-            $custom_post_types = LoaderFactory::getLoader()->getShared(
149
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
150
-            );
151
-            $cpts = $custom_post_types->getPrivateCustomPostTypes();
152
-            foreach ($cpts as $cpt => $details) {
153
-                $clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
154
-            }
155
-        }
156
-        return $clauses;
157
-    }
158
-
159
-
160
-    /**
161
-     * @return void
162
-     * @throws InvalidArgumentException
163
-     * @throws InvalidDataTypeException
164
-     * @throws InvalidInterfaceException
165
-     */
166
-    public function employ_CPT_Strategy()
167
-    {
168
-        if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
169
-            LoaderFactory::getLoader()->getShared('EE_CPT_Strategy');
170
-        }
171
-    }
172
-
173
-
174
-    /**
175
-     * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
176
-     *
177
-     * @param  string $url incoming url
178
-     * @return string         final assembled url
179
-     */
180
-    public function maybe_force_admin_ajax_ssl($url)
181
-    {
182
-        if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
183
-            $url = str_replace('http://', 'https://', $url);
184
-        }
185
-        return $url;
186
-    }
187
-
188
-
189
-
190
-
191
-
192
-
193
-    /***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
194
-
195
-
196
-    /**
197
-     *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
198
-     *    default priority init phases have run
199
-     *
200
-     * @access    public
201
-     * @return    void
202
-     */
203
-    public function wp_loaded()
204
-    {
205
-    }
206
-
207
-
208
-
209
-
210
-
211
-    /***********************************************        PARSE_REQUEST HOOK         ***********************************************/
212
-    /**
213
-     *    _get_request
214
-     *
215
-     * @access public
216
-     * @param WP $WP
217
-     * @return void
218
-     */
219
-    public function get_request(WP $WP)
220
-    {
221
-        do_action('AHEE__EE_Front_Controller__get_request__start');
222
-        $this->Request_Handler->parse_request($WP);
223
-        do_action('AHEE__EE_Front_Controller__get_request__complete');
224
-    }
225
-
226
-
227
-    /**
228
-     *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
229
-     *
230
-     * @access    public
231
-     * @param   WP_Query $WP_Query
232
-     * @return    void
233
-     */
234
-    public function pre_get_posts($WP_Query)
235
-    {
236
-        // only load Module_Request_Router if this is the main query
237
-        if ($this->Module_Request_Router instanceof EE_Module_Request_Router
238
-            && $WP_Query->is_main_query()
239
-        ) {
240
-            // cycle thru module routes
241
-            while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
242
-                // determine module and method for route
243
-                $module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
244
-                if ($module instanceof EED_Module) {
245
-                    // get registered view for route
246
-                    $this->_template_path = $this->Module_Request_Router->get_view($route);
247
-                    // grab module name
248
-                    $module_name = $module->module_name();
249
-                    // map the module to the module objects
250
-                    $this->Registry->modules->{$module_name} = $module;
251
-                }
252
-            }
253
-        }
254
-    }
255
-
256
-
257
-
258
-
259
-
260
-    /***********************************************        WP HOOK         ***********************************************/
261
-
262
-
263
-    /**
264
-     *    wp - basically last chance to do stuff before headers sent
265
-     *
266
-     * @access    public
267
-     * @return    void
268
-     */
269
-    public function wp()
270
-    {
271
-    }
272
-
273
-
274
-
275
-    /***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
276
-
277
-
278
-    /**
279
-     * callback for the "template_redirect" hook point
280
-     * checks sidebars for EE widgets
281
-     * loads resources and assets accordingly
282
-     *
283
-     * @return void
284
-     */
285
-    public function templateRedirect()
286
-    {
287
-        global $wp_query;
288
-        if (empty($wp_query->posts)) {
289
-            return;
290
-        }
291
-        // if we already know this is an espresso page, then load assets
292
-        $load_assets = $this->Request_Handler->is_espresso_page();
293
-        // if we are already loading assets then just move along, otherwise check for widgets
294
-        $load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
295
-        if ($load_assets) {
296
-            add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
297
-            add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
298
-        }
299
-    }
300
-
301
-
302
-    /**
303
-     * builds list of active widgets then scans active sidebars looking for them
304
-     * returns true is an EE widget is found in an active sidebar
305
-     * Please Note: this does NOT mean that the sidebar or widget
306
-     * is actually in use in a given template, as that is unfortunately not known
307
-     * until a sidebar and it's widgets are actually loaded
308
-     *
309
-     * @return boolean
310
-     */
311
-    private function espresso_widgets_in_active_sidebars()
312
-    {
313
-        $espresso_widgets = array();
314
-        foreach ($this->Registry->widgets as $widget_class => $widget) {
315
-            $id_base = EspressoWidget::getIdBase($widget_class);
316
-            if (is_active_widget(false, false, $id_base)) {
317
-                $espresso_widgets[] = $id_base;
318
-            }
319
-        }
320
-        $all_sidebar_widgets = wp_get_sidebars_widgets();
321
-        foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
322
-            if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
323
-                foreach ($sidebar_widgets as $sidebar_widget) {
324
-                    foreach ($espresso_widgets as $espresso_widget) {
325
-                        if (strpos($sidebar_widget, $espresso_widget) !== false) {
326
-                            return true;
327
-                        }
328
-                    }
329
-                }
330
-            }
331
-        }
332
-        return false;
333
-    }
334
-
335
-
336
-    /**
337
-     *    header_meta_tag
338
-     *
339
-     * @access    public
340
-     * @return    void
341
-     */
342
-    public function header_meta_tag()
343
-    {
344
-        print(
345
-        apply_filters(
346
-            'FHEE__EE_Front_Controller__header_meta_tag',
347
-            '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
348
-        )
349
-        );
350
-
351
-        // let's exclude all event type taxonomy term archive pages from search engine indexing
352
-        // @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
353
-        // also exclude all critical pages from indexing
354
-        if ((
355
-                is_tax('espresso_event_type')
356
-                && get_option('blog_public') !== '0'
357
-            )
358
-            || is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
359
-        ) {
360
-            print(
361
-            apply_filters(
362
-                'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
363
-                '<meta name="robots" content="noindex,follow" />' . "\n"
364
-            )
365
-            );
366
-        }
367
-    }
368
-
369
-
370
-    /**
371
-     * wp_print_scripts
372
-     *
373
-     * @return void
374
-     */
375
-    public function wp_print_scripts()
376
-    {
377
-        global $post;
378
-        if (isset($post->EE_Event)
379
-            && $post->EE_Event instanceof EE_Event
380
-            && get_post_type() === 'espresso_events'
381
-            && is_singular()
382
-        ) {
383
-            \EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
384
-        }
385
-    }
386
-
387
-
388
-    public function enqueueStyle()
389
-    {
390
-        wp_enqueue_style('espresso_default');
391
-        wp_enqueue_style('espresso_custom_css');
392
-    }
393
-
394
-
395
-
396
-    /***********************************************        WP_FOOTER         ***********************************************/
397
-
398
-
399
-    public function enqueueScripts()
400
-    {
401
-        wp_enqueue_script('espresso_core');
402
-    }
403
-
404
-
405
-    /**
406
-     * display_errors
407
-     *
408
-     * @access public
409
-     * @return void
410
-     * @throws DomainException
411
-     */
412
-    public function display_errors()
413
-    {
414
-        static $shown_already = false;
415
-        do_action('AHEE__EE_Front_Controller__display_errors__begin');
416
-        if (! $shown_already
417
-            && apply_filters('FHEE__EE_Front_Controller__display_errors', true)
418
-            && is_main_query()
419
-            && ! is_feed()
420
-            && in_the_loop()
421
-            && did_action('wp_head')
422
-            && $this->Request_Handler->is_espresso_page()
423
-        ) {
424
-            echo EE_Error::get_notices();
425
-            $shown_already = true;
426
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
427
-        }
428
-        do_action('AHEE__EE_Front_Controller__display_errors__end');
429
-    }
430
-
431
-
432
-
433
-
434
-
435
-    /***********************************************        UTILITIES         ***********************************************/
436
-    /**
437
-     *    template_include
438
-     *
439
-     * @access    public
440
-     * @param   string $template_include_path
441
-     * @return    string
442
-     */
443
-    public function template_include($template_include_path = null)
444
-    {
445
-        if ($this->Request_Handler->is_espresso_page()) {
446
-            $this->_template_path = ! empty($this->_template_path)
447
-                ? basename($this->_template_path)
448
-                : basename(
449
-                    $template_include_path
450
-                );
451
-            $template_path = EEH_Template::locate_template($this->_template_path, array(), false);
452
-            $this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
453
-            $this->_template = basename($this->_template_path);
454
-            return $this->_template_path;
455
-        }
456
-        return $template_include_path;
457
-    }
458
-
459
-
460
-    /**
461
-     *    get_selected_template
462
-     *
463
-     * @access    public
464
-     * @param bool $with_path
465
-     * @return    string
466
-     */
467
-    public function get_selected_template($with_path = false)
468
-    {
469
-        return $with_path ? $this->_template_path : $this->_template;
470
-    }
471
-
472
-
473
-    /**
474
-     * @deprecated 4.9.26
475
-     * @param string $shortcode_class
476
-     * @param \WP    $wp
477
-     */
478
-    public function initialize_shortcode($shortcode_class = '', WP $wp = null)
479
-    {
480
-        \EE_Error::doing_it_wrong(
481
-            __METHOD__,
482
-            __(
483
-                'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
484
-                'event_espresso'
485
-            ),
486
-            '4.9.26'
487
-        );
488
-        $this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
489
-    }
490
-
491
-
492
-    /**
493
-     * @return void
494
-     * @deprecated 4.9.57.p
495
-     */
496
-    public function loadPersistentAdminNoticeManager()
497
-    {
498
-    }
29
+	/**
30
+	 * @var string $_template_path
31
+	 */
32
+	private $_template_path;
33
+
34
+	/**
35
+	 * @var string $_template
36
+	 */
37
+	private $_template;
38
+
39
+	/**
40
+	 * @type EE_Registry $Registry
41
+	 */
42
+	protected $Registry;
43
+
44
+	/**
45
+	 * @type EE_Request_Handler $Request_Handler
46
+	 */
47
+	protected $Request_Handler;
48
+
49
+	/**
50
+	 * @type EE_Module_Request_Router $Module_Request_Router
51
+	 */
52
+	protected $Module_Request_Router;
53
+
54
+
55
+	/**
56
+	 *    class constructor
57
+	 *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
58
+	 *
59
+	 * @access    public
60
+	 * @param \EE_Registry              $Registry
61
+	 * @param \EE_Request_Handler       $Request_Handler
62
+	 * @param \EE_Module_Request_Router $Module_Request_Router
63
+	 */
64
+	public function __construct(
65
+		EE_Registry $Registry,
66
+		EE_Request_Handler $Request_Handler,
67
+		EE_Module_Request_Router $Module_Request_Router
68
+	) {
69
+		$this->Registry = $Registry;
70
+		$this->Request_Handler = $Request_Handler;
71
+		$this->Module_Request_Router = $Module_Request_Router;
72
+		// determine how to integrate WP_Query with the EE models
73
+		add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
74
+		// load other resources and begin to actually run shortcodes and modules
75
+		add_action('wp_loaded', array($this, 'wp_loaded'), 5);
76
+		// analyse the incoming WP request
77
+		add_action('parse_request', array($this, 'get_request'), 1, 1);
78
+		// process request with module factory
79
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
80
+		// before headers sent
81
+		add_action('wp', array($this, 'wp'), 5);
82
+		// primarily used to process any content shortcodes
83
+		add_action('template_redirect', array($this, 'templateRedirect'), 999);
84
+		// header
85
+		add_action('wp_head', array($this, 'header_meta_tag'), 5);
86
+		add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
87
+		add_filter('template_include', array($this, 'template_include'), 1);
88
+		// display errors
89
+		add_action('loop_start', array($this, 'display_errors'), 2);
90
+		// the content
91
+		// add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
92
+		// exclude our private cpt comments
93
+		add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
94
+		// make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
95
+		add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
96
+		// action hook EE
97
+		do_action('AHEE__EE_Front_Controller__construct__done', $this);
98
+	}
99
+
100
+
101
+	/**
102
+	 * @return EE_Request_Handler
103
+	 */
104
+	public function Request_Handler()
105
+	{
106
+		return $this->Request_Handler;
107
+	}
108
+
109
+
110
+	/**
111
+	 * @return EE_Module_Request_Router
112
+	 */
113
+	public function Module_Request_Router()
114
+	{
115
+		return $this->Module_Request_Router;
116
+	}
117
+
118
+
119
+	/**
120
+	 * @return LegacyShortcodesManager
121
+	 */
122
+	public function getLegacyShortcodesManager()
123
+	{
124
+		return EE_Config::getLegacyShortcodesManager();
125
+	}
126
+
127
+
128
+
129
+
130
+
131
+	/***********************************************        INIT ACTION HOOK         ***********************************************/
132
+	/**
133
+	 * filter_wp_comments
134
+	 * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
135
+	 * widgets/queries done on frontend
136
+	 *
137
+	 * @param  array $clauses array of comment clauses setup by WP_Comment_Query
138
+	 * @return array array of comment clauses with modifications.
139
+	 * @throws InvalidArgumentException
140
+	 * @throws InvalidDataTypeException
141
+	 * @throws InvalidInterfaceException
142
+	 */
143
+	public function filter_wp_comments($clauses)
144
+	{
145
+		global $wpdb;
146
+		if (strpos($clauses['join'], $wpdb->posts) !== false) {
147
+			/** @var EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions $custom_post_types */
148
+			$custom_post_types = LoaderFactory::getLoader()->getShared(
149
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'
150
+			);
151
+			$cpts = $custom_post_types->getPrivateCustomPostTypes();
152
+			foreach ($cpts as $cpt => $details) {
153
+				$clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
154
+			}
155
+		}
156
+		return $clauses;
157
+	}
158
+
159
+
160
+	/**
161
+	 * @return void
162
+	 * @throws InvalidArgumentException
163
+	 * @throws InvalidDataTypeException
164
+	 * @throws InvalidInterfaceException
165
+	 */
166
+	public function employ_CPT_Strategy()
167
+	{
168
+		if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
169
+			LoaderFactory::getLoader()->getShared('EE_CPT_Strategy');
170
+		}
171
+	}
172
+
173
+
174
+	/**
175
+	 * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
176
+	 *
177
+	 * @param  string $url incoming url
178
+	 * @return string         final assembled url
179
+	 */
180
+	public function maybe_force_admin_ajax_ssl($url)
181
+	{
182
+		if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
183
+			$url = str_replace('http://', 'https://', $url);
184
+		}
185
+		return $url;
186
+	}
187
+
188
+
189
+
190
+
191
+
192
+
193
+	/***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
194
+
195
+
196
+	/**
197
+	 *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
198
+	 *    default priority init phases have run
199
+	 *
200
+	 * @access    public
201
+	 * @return    void
202
+	 */
203
+	public function wp_loaded()
204
+	{
205
+	}
206
+
207
+
208
+
209
+
210
+
211
+	/***********************************************        PARSE_REQUEST HOOK         ***********************************************/
212
+	/**
213
+	 *    _get_request
214
+	 *
215
+	 * @access public
216
+	 * @param WP $WP
217
+	 * @return void
218
+	 */
219
+	public function get_request(WP $WP)
220
+	{
221
+		do_action('AHEE__EE_Front_Controller__get_request__start');
222
+		$this->Request_Handler->parse_request($WP);
223
+		do_action('AHEE__EE_Front_Controller__get_request__complete');
224
+	}
225
+
226
+
227
+	/**
228
+	 *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
229
+	 *
230
+	 * @access    public
231
+	 * @param   WP_Query $WP_Query
232
+	 * @return    void
233
+	 */
234
+	public function pre_get_posts($WP_Query)
235
+	{
236
+		// only load Module_Request_Router if this is the main query
237
+		if ($this->Module_Request_Router instanceof EE_Module_Request_Router
238
+			&& $WP_Query->is_main_query()
239
+		) {
240
+			// cycle thru module routes
241
+			while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
242
+				// determine module and method for route
243
+				$module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
244
+				if ($module instanceof EED_Module) {
245
+					// get registered view for route
246
+					$this->_template_path = $this->Module_Request_Router->get_view($route);
247
+					// grab module name
248
+					$module_name = $module->module_name();
249
+					// map the module to the module objects
250
+					$this->Registry->modules->{$module_name} = $module;
251
+				}
252
+			}
253
+		}
254
+	}
255
+
256
+
257
+
258
+
259
+
260
+	/***********************************************        WP HOOK         ***********************************************/
261
+
262
+
263
+	/**
264
+	 *    wp - basically last chance to do stuff before headers sent
265
+	 *
266
+	 * @access    public
267
+	 * @return    void
268
+	 */
269
+	public function wp()
270
+	{
271
+	}
272
+
273
+
274
+
275
+	/***********************     GET_HEADER && WP_HEAD HOOK     ***********************/
276
+
277
+
278
+	/**
279
+	 * callback for the "template_redirect" hook point
280
+	 * checks sidebars for EE widgets
281
+	 * loads resources and assets accordingly
282
+	 *
283
+	 * @return void
284
+	 */
285
+	public function templateRedirect()
286
+	{
287
+		global $wp_query;
288
+		if (empty($wp_query->posts)) {
289
+			return;
290
+		}
291
+		// if we already know this is an espresso page, then load assets
292
+		$load_assets = $this->Request_Handler->is_espresso_page();
293
+		// if we are already loading assets then just move along, otherwise check for widgets
294
+		$load_assets = $load_assets ? $load_assets : $this->espresso_widgets_in_active_sidebars();
295
+		if ($load_assets) {
296
+			add_action('wp_enqueue_scripts', array($this, 'enqueueStyle'), 10);
297
+			add_action('wp_print_footer_scripts', array($this, 'enqueueScripts'), 10);
298
+		}
299
+	}
300
+
301
+
302
+	/**
303
+	 * builds list of active widgets then scans active sidebars looking for them
304
+	 * returns true is an EE widget is found in an active sidebar
305
+	 * Please Note: this does NOT mean that the sidebar or widget
306
+	 * is actually in use in a given template, as that is unfortunately not known
307
+	 * until a sidebar and it's widgets are actually loaded
308
+	 *
309
+	 * @return boolean
310
+	 */
311
+	private function espresso_widgets_in_active_sidebars()
312
+	{
313
+		$espresso_widgets = array();
314
+		foreach ($this->Registry->widgets as $widget_class => $widget) {
315
+			$id_base = EspressoWidget::getIdBase($widget_class);
316
+			if (is_active_widget(false, false, $id_base)) {
317
+				$espresso_widgets[] = $id_base;
318
+			}
319
+		}
320
+		$all_sidebar_widgets = wp_get_sidebars_widgets();
321
+		foreach ($all_sidebar_widgets as $sidebar_name => $sidebar_widgets) {
322
+			if (is_array($sidebar_widgets) && ! empty($sidebar_widgets)) {
323
+				foreach ($sidebar_widgets as $sidebar_widget) {
324
+					foreach ($espresso_widgets as $espresso_widget) {
325
+						if (strpos($sidebar_widget, $espresso_widget) !== false) {
326
+							return true;
327
+						}
328
+					}
329
+				}
330
+			}
331
+		}
332
+		return false;
333
+	}
334
+
335
+
336
+	/**
337
+	 *    header_meta_tag
338
+	 *
339
+	 * @access    public
340
+	 * @return    void
341
+	 */
342
+	public function header_meta_tag()
343
+	{
344
+		print(
345
+		apply_filters(
346
+			'FHEE__EE_Front_Controller__header_meta_tag',
347
+			'<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n"
348
+		)
349
+		);
350
+
351
+		// let's exclude all event type taxonomy term archive pages from search engine indexing
352
+		// @see https://events.codebasehq.com/projects/event-espresso/tickets/10249
353
+		// also exclude all critical pages from indexing
354
+		if ((
355
+				is_tax('espresso_event_type')
356
+				&& get_option('blog_public') !== '0'
357
+			)
358
+			|| is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
359
+		) {
360
+			print(
361
+			apply_filters(
362
+				'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
363
+				'<meta name="robots" content="noindex,follow" />' . "\n"
364
+			)
365
+			);
366
+		}
367
+	}
368
+
369
+
370
+	/**
371
+	 * wp_print_scripts
372
+	 *
373
+	 * @return void
374
+	 */
375
+	public function wp_print_scripts()
376
+	{
377
+		global $post;
378
+		if (isset($post->EE_Event)
379
+			&& $post->EE_Event instanceof EE_Event
380
+			&& get_post_type() === 'espresso_events'
381
+			&& is_singular()
382
+		) {
383
+			\EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
384
+		}
385
+	}
386
+
387
+
388
+	public function enqueueStyle()
389
+	{
390
+		wp_enqueue_style('espresso_default');
391
+		wp_enqueue_style('espresso_custom_css');
392
+	}
393
+
394
+
395
+
396
+	/***********************************************        WP_FOOTER         ***********************************************/
397
+
398
+
399
+	public function enqueueScripts()
400
+	{
401
+		wp_enqueue_script('espresso_core');
402
+	}
403
+
404
+
405
+	/**
406
+	 * display_errors
407
+	 *
408
+	 * @access public
409
+	 * @return void
410
+	 * @throws DomainException
411
+	 */
412
+	public function display_errors()
413
+	{
414
+		static $shown_already = false;
415
+		do_action('AHEE__EE_Front_Controller__display_errors__begin');
416
+		if (! $shown_already
417
+			&& apply_filters('FHEE__EE_Front_Controller__display_errors', true)
418
+			&& is_main_query()
419
+			&& ! is_feed()
420
+			&& in_the_loop()
421
+			&& did_action('wp_head')
422
+			&& $this->Request_Handler->is_espresso_page()
423
+		) {
424
+			echo EE_Error::get_notices();
425
+			$shown_already = true;
426
+			EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
427
+		}
428
+		do_action('AHEE__EE_Front_Controller__display_errors__end');
429
+	}
430
+
431
+
432
+
433
+
434
+
435
+	/***********************************************        UTILITIES         ***********************************************/
436
+	/**
437
+	 *    template_include
438
+	 *
439
+	 * @access    public
440
+	 * @param   string $template_include_path
441
+	 * @return    string
442
+	 */
443
+	public function template_include($template_include_path = null)
444
+	{
445
+		if ($this->Request_Handler->is_espresso_page()) {
446
+			$this->_template_path = ! empty($this->_template_path)
447
+				? basename($this->_template_path)
448
+				: basename(
449
+					$template_include_path
450
+				);
451
+			$template_path = EEH_Template::locate_template($this->_template_path, array(), false);
452
+			$this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
453
+			$this->_template = basename($this->_template_path);
454
+			return $this->_template_path;
455
+		}
456
+		return $template_include_path;
457
+	}
458
+
459
+
460
+	/**
461
+	 *    get_selected_template
462
+	 *
463
+	 * @access    public
464
+	 * @param bool $with_path
465
+	 * @return    string
466
+	 */
467
+	public function get_selected_template($with_path = false)
468
+	{
469
+		return $with_path ? $this->_template_path : $this->_template;
470
+	}
471
+
472
+
473
+	/**
474
+	 * @deprecated 4.9.26
475
+	 * @param string $shortcode_class
476
+	 * @param \WP    $wp
477
+	 */
478
+	public function initialize_shortcode($shortcode_class = '', WP $wp = null)
479
+	{
480
+		\EE_Error::doing_it_wrong(
481
+			__METHOD__,
482
+			__(
483
+				'Usage is deprecated. Please use \EventEspresso\core\services\shortcodes\LegacyShortcodesManager::initializeShortcode() instead.',
484
+				'event_espresso'
485
+			),
486
+			'4.9.26'
487
+		);
488
+		$this->getLegacyShortcodesManager()->initializeShortcode($shortcode_class, $wp);
489
+	}
490
+
491
+
492
+	/**
493
+	 * @return void
494
+	 * @deprecated 4.9.57.p
495
+	 */
496
+	public function loadPersistentAdminNoticeManager()
497
+	{
498
+	}
499 499
 }
Please login to merge, or discard this patch.
core/EE_Dependency_Map.core.php 1 patch
Indentation   +981 added lines, -981 removed lines patch added patch discarded remove patch
@@ -20,985 +20,985 @@
 block discarded – undo
20 20
 class EE_Dependency_Map
21 21
 {
22 22
 
23
-    /**
24
-     * This means that the requested class dependency is not present in the dependency map
25
-     */
26
-    const not_registered = 0;
27
-
28
-    /**
29
-     * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
30
-     */
31
-    const load_new_object = 1;
32
-
33
-    /**
34
-     * This instructs class loaders to return a previously instantiated and cached object for the requested class.
35
-     * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
36
-     */
37
-    const load_from_cache = 2;
38
-
39
-    /**
40
-     * When registering a dependency,
41
-     * this indicates to keep any existing dependencies that already exist,
42
-     * and simply discard any new dependencies declared in the incoming data
43
-     */
44
-    const KEEP_EXISTING_DEPENDENCIES = 0;
45
-
46
-    /**
47
-     * When registering a dependency,
48
-     * this indicates to overwrite any existing dependencies that already exist using the incoming data
49
-     */
50
-    const OVERWRITE_DEPENDENCIES = 1;
51
-
52
-
53
-    /**
54
-     * @type EE_Dependency_Map $_instance
55
-     */
56
-    protected static $_instance;
57
-
58
-    /**
59
-     * @var ClassInterfaceCache $class_cache
60
-     */
61
-    private $class_cache;
62
-
63
-    /**
64
-     * @type RequestInterface $request
65
-     */
66
-    protected $request;
67
-
68
-    /**
69
-     * @type LegacyRequestInterface $legacy_request
70
-     */
71
-    protected $legacy_request;
72
-
73
-    /**
74
-     * @type ResponseInterface $response
75
-     */
76
-    protected $response;
77
-
78
-    /**
79
-     * @type LoaderInterface $loader
80
-     */
81
-    protected $loader;
82
-
83
-    /**
84
-     * @type array $_dependency_map
85
-     */
86
-    protected $_dependency_map = array();
87
-
88
-    /**
89
-     * @type array $_class_loaders
90
-     */
91
-    protected $_class_loaders = array();
92
-
93
-
94
-    /**
95
-     * EE_Dependency_Map constructor.
96
-     *
97
-     * @param ClassInterfaceCache $class_cache
98
-     */
99
-    protected function __construct(ClassInterfaceCache $class_cache)
100
-    {
101
-        $this->class_cache = $class_cache;
102
-        do_action('EE_Dependency_Map____construct', $this);
103
-    }
104
-
105
-
106
-    /**
107
-     * @return void
108
-     */
109
-    public function initialize()
110
-    {
111
-        $this->_register_core_dependencies();
112
-        $this->_register_core_class_loaders();
113
-        $this->_register_core_aliases();
114
-    }
115
-
116
-
117
-    /**
118
-     * @singleton method used to instantiate class object
119
-     * @param ClassInterfaceCache|null $class_cache
120
-     * @return EE_Dependency_Map
121
-     */
122
-    public static function instance(ClassInterfaceCache $class_cache = null)
123
-    {
124
-        // check if class object is instantiated, and instantiated properly
125
-        if (! self::$_instance instanceof EE_Dependency_Map
126
-            && $class_cache instanceof ClassInterfaceCache
127
-        ) {
128
-            self::$_instance = new EE_Dependency_Map($class_cache);
129
-        }
130
-        return self::$_instance;
131
-    }
132
-
133
-
134
-    /**
135
-     * @param RequestInterface $request
136
-     */
137
-    public function setRequest(RequestInterface $request)
138
-    {
139
-        $this->request = $request;
140
-    }
141
-
142
-
143
-    /**
144
-     * @param LegacyRequestInterface $legacy_request
145
-     */
146
-    public function setLegacyRequest(LegacyRequestInterface $legacy_request)
147
-    {
148
-        $this->legacy_request = $legacy_request;
149
-    }
150
-
151
-
152
-    /**
153
-     * @param ResponseInterface $response
154
-     */
155
-    public function setResponse(ResponseInterface $response)
156
-    {
157
-        $this->response = $response;
158
-    }
159
-
160
-
161
-    /**
162
-     * @param LoaderInterface $loader
163
-     */
164
-    public function setLoader(LoaderInterface $loader)
165
-    {
166
-        $this->loader = $loader;
167
-    }
168
-
169
-
170
-    /**
171
-     * @param string $class
172
-     * @param array  $dependencies
173
-     * @param int    $overwrite
174
-     * @return bool
175
-     */
176
-    public static function register_dependencies(
177
-        $class,
178
-        array $dependencies,
179
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
180
-    ) {
181
-        return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
182
-    }
183
-
184
-
185
-    /**
186
-     * Assigns an array of class names and corresponding load sources (new or cached)
187
-     * to the class specified by the first parameter.
188
-     * IMPORTANT !!!
189
-     * The order of elements in the incoming $dependencies array MUST match
190
-     * the order of the constructor parameters for the class in question.
191
-     * This is especially important when overriding any existing dependencies that are registered.
192
-     * the third parameter controls whether any duplicate dependencies are overwritten or not.
193
-     *
194
-     * @param string $class
195
-     * @param array  $dependencies
196
-     * @param int    $overwrite
197
-     * @return bool
198
-     */
199
-    public function registerDependencies(
200
-        $class,
201
-        array $dependencies,
202
-        $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
203
-    ) {
204
-        $class = trim($class, '\\');
205
-        $registered = false;
206
-        if (empty(self::$_instance->_dependency_map[ $class ])) {
207
-            self::$_instance->_dependency_map[ $class ] = array();
208
-        }
209
-        // we need to make sure that any aliases used when registering a dependency
210
-        // get resolved to the correct class name
211
-        foreach ($dependencies as $dependency => $load_source) {
212
-            $alias = self::$_instance->getFqnForAlias($dependency);
213
-            if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
214
-                || ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
215
-            ) {
216
-                unset($dependencies[ $dependency ]);
217
-                $dependencies[ $alias ] = $load_source;
218
-                $registered = true;
219
-            }
220
-        }
221
-        // now add our two lists of dependencies together.
222
-        // using Union (+=) favours the arrays in precedence from left to right,
223
-        // so $dependencies is NOT overwritten because it is listed first
224
-        // ie: with A = B + C, entries in B take precedence over duplicate entries in C
225
-        // Union is way faster than array_merge() but should be used with caution...
226
-        // especially with numerically indexed arrays
227
-        $dependencies += self::$_instance->_dependency_map[ $class ];
228
-        // now we need to ensure that the resulting dependencies
229
-        // array only has the entries that are required for the class
230
-        // so first count how many dependencies were originally registered for the class
231
-        $dependency_count = count(self::$_instance->_dependency_map[ $class ]);
232
-        // if that count is non-zero (meaning dependencies were already registered)
233
-        self::$_instance->_dependency_map[ $class ] = $dependency_count
234
-            // then truncate the  final array to match that count
235
-            ? array_slice($dependencies, 0, $dependency_count)
236
-            // otherwise just take the incoming array because nothing previously existed
237
-            : $dependencies;
238
-        return $registered;
239
-    }
240
-
241
-
242
-    /**
243
-     * @param string $class_name
244
-     * @param string $loader
245
-     * @return bool
246
-     * @throws DomainException
247
-     */
248
-    public static function register_class_loader($class_name, $loader = 'load_core')
249
-    {
250
-        if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
251
-            throw new DomainException(
252
-                esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
253
-            );
254
-        }
255
-        // check that loader is callable or method starts with "load_" and exists in EE_Registry
256
-        if (! is_callable($loader)
257
-            && (
258
-                strpos($loader, 'load_') !== 0
259
-                || ! method_exists('EE_Registry', $loader)
260
-            )
261
-        ) {
262
-            throw new DomainException(
263
-                sprintf(
264
-                    esc_html__(
265
-                        '"%1$s" is not a valid loader method on EE_Registry.',
266
-                        'event_espresso'
267
-                    ),
268
-                    $loader
269
-                )
270
-            );
271
-        }
272
-        $class_name = self::$_instance->getFqnForAlias($class_name);
273
-        if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
274
-            self::$_instance->_class_loaders[ $class_name ] = $loader;
275
-            return true;
276
-        }
277
-        return false;
278
-    }
279
-
280
-
281
-    /**
282
-     * @return array
283
-     */
284
-    public function dependency_map()
285
-    {
286
-        return $this->_dependency_map;
287
-    }
288
-
289
-
290
-    /**
291
-     * returns TRUE if dependency map contains a listing for the provided class name
292
-     *
293
-     * @param string $class_name
294
-     * @return boolean
295
-     */
296
-    public function has($class_name = '')
297
-    {
298
-        // all legacy models have the same dependencies
299
-        if (strpos($class_name, 'EEM_') === 0) {
300
-            $class_name = 'LEGACY_MODELS';
301
-        }
302
-        return isset($this->_dependency_map[ $class_name ]) ? true : false;
303
-    }
304
-
305
-
306
-    /**
307
-     * returns TRUE if dependency map contains a listing for the provided class name AND dependency
308
-     *
309
-     * @param string $class_name
310
-     * @param string $dependency
311
-     * @return bool
312
-     */
313
-    public function has_dependency_for_class($class_name = '', $dependency = '')
314
-    {
315
-        // all legacy models have the same dependencies
316
-        if (strpos($class_name, 'EEM_') === 0) {
317
-            $class_name = 'LEGACY_MODELS';
318
-        }
319
-        $dependency = $this->getFqnForAlias($dependency, $class_name);
320
-        return isset($this->_dependency_map[ $class_name ][ $dependency ])
321
-            ? true
322
-            : false;
323
-    }
324
-
325
-
326
-    /**
327
-     * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
328
-     *
329
-     * @param string $class_name
330
-     * @param string $dependency
331
-     * @return int
332
-     */
333
-    public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
334
-    {
335
-        // all legacy models have the same dependencies
336
-        if (strpos($class_name, 'EEM_') === 0) {
337
-            $class_name = 'LEGACY_MODELS';
338
-        }
339
-        $dependency = $this->getFqnForAlias($dependency);
340
-        return $this->has_dependency_for_class($class_name, $dependency)
341
-            ? $this->_dependency_map[ $class_name ][ $dependency ]
342
-            : EE_Dependency_Map::not_registered;
343
-    }
344
-
345
-
346
-    /**
347
-     * @param string $class_name
348
-     * @return string | Closure
349
-     */
350
-    public function class_loader($class_name)
351
-    {
352
-        // all legacy models use load_model()
353
-        if (strpos($class_name, 'EEM_') === 0) {
354
-            return 'load_model';
355
-        }
356
-        $class_name = $this->getFqnForAlias($class_name);
357
-        return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
358
-    }
359
-
360
-
361
-    /**
362
-     * @return array
363
-     */
364
-    public function class_loaders()
365
-    {
366
-        return $this->_class_loaders;
367
-    }
368
-
369
-
370
-    /**
371
-     * adds an alias for a classname
372
-     *
373
-     * @param string $fqcn      the class name that should be used (concrete class to replace interface)
374
-     * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
375
-     * @param string $for_class the class that has the dependency (is type hinting for the interface)
376
-     */
377
-    public function add_alias($fqcn, $alias, $for_class = '')
378
-    {
379
-        $this->class_cache->addAlias($fqcn, $alias, $for_class);
380
-    }
381
-
382
-
383
-    /**
384
-     * Returns TRUE if the provided fully qualified name IS an alias
385
-     * WHY?
386
-     * Because if a class is type hinting for a concretion,
387
-     * then why would we need to find another class to supply it?
388
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
389
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
390
-     * Don't go looking for some substitute.
391
-     * Whereas if a class is type hinting for an interface...
392
-     * then we need to find an actual class to use.
393
-     * So the interface IS the alias for some other FQN,
394
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
395
-     * represents some other class.
396
-     *
397
-     * @param string $fqn
398
-     * @param string $for_class
399
-     * @return bool
400
-     */
401
-    public function isAlias($fqn = '', $for_class = '')
402
-    {
403
-        return $this->class_cache->isAlias($fqn, $for_class);
404
-    }
405
-
406
-
407
-    /**
408
-     * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
409
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
410
-     *  for example:
411
-     *      if the following two entries were added to the _aliases array:
412
-     *          array(
413
-     *              'interface_alias'           => 'some\namespace\interface'
414
-     *              'some\namespace\interface'  => 'some\namespace\classname'
415
-     *          )
416
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
417
-     *      to load an instance of 'some\namespace\classname'
418
-     *
419
-     * @param string $alias
420
-     * @param string $for_class
421
-     * @return string
422
-     */
423
-    public function getFqnForAlias($alias = '', $for_class = '')
424
-    {
425
-        return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
426
-    }
427
-
428
-
429
-    /**
430
-     * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
431
-     * if one exists, or whether a new object should be generated every time the requested class is loaded.
432
-     * This is done by using the following class constants:
433
-     *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
434
-     *        EE_Dependency_Map::load_new_object - generates a new object every time
435
-     */
436
-    protected function _register_core_dependencies()
437
-    {
438
-        $this->_dependency_map = array(
439
-            'EE_Request_Handler'                                                                                          => array(
440
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
441
-            ),
442
-            'EE_System'                                                                                                   => array(
443
-                'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
444
-                'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
445
-                'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
446
-                'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
447
-            ),
448
-            'EE_Session'                                                                                                  => array(
449
-                'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
450
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
451
-                'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
452
-                'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
453
-            ),
454
-            'EE_Cart'                                                                                                     => array(
455
-                'EE_Session' => EE_Dependency_Map::load_from_cache,
456
-            ),
457
-            'EE_Front_Controller'                                                                                         => array(
458
-                'EE_Registry'              => EE_Dependency_Map::load_from_cache,
459
-                'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
460
-                'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
461
-            ),
462
-            'EE_Messenger_Collection_Loader'                                                                              => array(
463
-                'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
464
-            ),
465
-            'EE_Message_Type_Collection_Loader'                                                                           => array(
466
-                'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
467
-            ),
468
-            'EE_Message_Resource_Manager'                                                                                 => array(
469
-                'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
470
-                'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
471
-                'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
472
-            ),
473
-            'EE_Message_Factory'                                                                                          => array(
474
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
475
-            ),
476
-            'EE_messages'                                                                                                 => array(
477
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
478
-            ),
479
-            'EE_Messages_Generator'                                                                                       => array(
480
-                'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
481
-                'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
482
-                'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
483
-                'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
484
-            ),
485
-            'EE_Messages_Processor'                                                                                       => array(
486
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
487
-            ),
488
-            'EE_Messages_Queue'                                                                                           => array(
489
-                'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
490
-            ),
491
-            'EE_Messages_Template_Defaults'                                                                               => array(
492
-                'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
493
-                'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
494
-            ),
495
-            'EE_Message_To_Generate_From_Request'                                                                         => array(
496
-                'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
497
-                'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
498
-            ),
499
-            'EventEspresso\core\services\commands\CommandBus'                                                             => array(
500
-                'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
501
-            ),
502
-            'EventEspresso\services\commands\CommandHandler'                                                              => array(
503
-                'EE_Registry'         => EE_Dependency_Map::load_from_cache,
504
-                'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
505
-            ),
506
-            'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
507
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
508
-            ),
509
-            'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
510
-                'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
511
-                'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
512
-            ),
513
-            'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
514
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
515
-            ),
516
-            'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
517
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
518
-            ),
519
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
520
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
521
-            ),
522
-            'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
523
-                'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
524
-            ),
525
-            'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
526
-                'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
527
-            ),
528
-            'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
529
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
530
-            ),
531
-            'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
532
-                'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
533
-            ),
534
-            'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
535
-                'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
536
-            ),
537
-            'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
538
-                'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
539
-            ),
540
-            'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
541
-                'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
542
-            ),
543
-            'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
544
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
545
-            ),
546
-            'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
547
-                'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
548
-            ),
549
-            'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
550
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
551
-            ),
552
-            'EventEspresso\core\services\database\TableManager'                                                           => array(
553
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
554
-            ),
555
-            'EE_Data_Migration_Class_Base'                                                                                => array(
556
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
557
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
558
-            ),
559
-            'EE_DMS_Core_4_1_0'                                                                                           => array(
560
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
561
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
562
-            ),
563
-            'EE_DMS_Core_4_2_0'                                                                                           => array(
564
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
565
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
566
-            ),
567
-            'EE_DMS_Core_4_3_0'                                                                                           => array(
568
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
569
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
570
-            ),
571
-            'EE_DMS_Core_4_4_0'                                                                                           => array(
572
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
573
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
574
-            ),
575
-            'EE_DMS_Core_4_5_0'                                                                                           => array(
576
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
577
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
578
-            ),
579
-            'EE_DMS_Core_4_6_0'                                                                                           => array(
580
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
581
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
582
-            ),
583
-            'EE_DMS_Core_4_7_0'                                                                                           => array(
584
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
585
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
586
-            ),
587
-            'EE_DMS_Core_4_8_0'                                                                                           => array(
588
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
589
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
590
-            ),
591
-            'EE_DMS_Core_4_9_0'                                                                                           => array(
592
-                'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
593
-                'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
594
-            ),
595
-            'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
596
-                array(),
597
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
598
-            ),
599
-            'EventEspresso\core\services\assets\Registry'                                                                 => array(
600
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
601
-                'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
602
-            ),
603
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
604
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
605
-            ),
606
-            'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
607
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
608
-            ),
609
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
610
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
611
-            ),
612
-            'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
613
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
614
-            ),
615
-            'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
616
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
617
-            ),
618
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
619
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
620
-            ),
621
-            'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
622
-                'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
623
-            ),
624
-            'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
625
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
626
-            ),
627
-            'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
628
-                'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
629
-            ),
630
-            'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
631
-                'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
632
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
633
-            ),
634
-            'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
635
-                null,
636
-                'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
637
-            ),
638
-            'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
639
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
640
-            ),
641
-            'LEGACY_MODELS'                                                                                               => array(
642
-                null,
643
-                'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
644
-            ),
645
-            'EE_Module_Request_Router'                                                                                    => array(
646
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
647
-            ),
648
-            'EE_Registration_Processor'                                                                                   => array(
649
-                'EE_Request' => EE_Dependency_Map::load_from_cache,
650
-            ),
651
-            'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
652
-                null,
653
-                'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
654
-                'EE_Request'                                                          => EE_Dependency_Map::load_from_cache,
655
-            ),
656
-            'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
657
-                'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
658
-                'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
659
-            ),
660
-            'EE_Admin_Transactions_List_Table'                                                                            => array(
661
-                null,
662
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
663
-            ),
664
-            'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
665
-                'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
666
-                'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
667
-                'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
668
-            ),
669
-            'EventEspresso\core\domain\services\pue\Config'                                                               => array(
670
-                'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
671
-                'EE_Config'         => EE_Dependency_Map::load_from_cache,
672
-            ),
673
-            'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
674
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
675
-                'EEM_Event'          => EE_Dependency_Map::load_from_cache,
676
-                'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
677
-                'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
678
-                'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
679
-                'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
680
-                'EE_Config'          => EE_Dependency_Map::load_from_cache,
681
-            ),
682
-            'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
683
-                'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
684
-            ),
685
-            'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
686
-                'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
687
-            ),
688
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
689
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
690
-                'EE_Session'             => EE_Dependency_Map::load_from_cache,
691
-            ),
692
-            'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
693
-                'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
694
-            ),
695
-            'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
696
-                'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
697
-                'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
698
-                'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
699
-                'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
700
-                'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
701
-            ),
702
-            'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
703
-                'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
704
-            ),
705
-            'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
706
-                'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
707
-                'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
708
-            ),
709
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
710
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
711
-            ),
712
-            'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
713
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
714
-            ),
715
-            'EE_CPT_Strategy'                                                                                             => array(
716
-                'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
717
-                'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
718
-            ),
719
-            'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
720
-                'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
721
-            ),
722
-            'EventEspresso\core\domain\entities\editor\blocks\CoreBlocksAssetManager'                                     => array(
723
-                'EventEspresso\core\domain\Domain'            => EE_Dependency_Map::load_from_cache,
724
-                'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
725
-            ),
726
-            'EventEspresso\core\services\assets\AssetManager'                                                             => array(
727
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
728
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
729
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
730
-            ),
731
-            'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
732
-                'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
733
-                'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
734
-                'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
735
-                'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
736
-                'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
737
-            ),
738
-            'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
739
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
740
-                'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
741
-            ),
742
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
743
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
744
-            ),
745
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
746
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
747
-                'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
748
-            ),
749
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
750
-                'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
751
-            ),
752
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
753
-                'EEM_Registration' => EE_Dependency_Map::load_from_cache,
754
-            ),
755
-            'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
756
-                'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
757
-            ),
758
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
759
-                'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
760
-            ),
761
-            'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
762
-                'EEM_Answer' => EE_Dependency_Map::load_from_cache,
763
-                'EEM_Question' => EE_Dependency_Map::load_from_cache,
764
-            ),
765
-        );
766
-    }
767
-
768
-
769
-    /**
770
-     * Registers how core classes are loaded.
771
-     * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
772
-     *        'EE_Request_Handler' => 'load_core'
773
-     *        'EE_Messages_Queue'  => 'load_lib'
774
-     *        'EEH_Debug_Tools'    => 'load_helper'
775
-     * or, if greater control is required, by providing a custom closure. For example:
776
-     *        'Some_Class' => function () {
777
-     *            return new Some_Class();
778
-     *        },
779
-     * This is required for instantiating dependencies
780
-     * where an interface has been type hinted in a class constructor. For example:
781
-     *        'Required_Interface' => function () {
782
-     *            return new A_Class_That_Implements_Required_Interface();
783
-     *        },
784
-     */
785
-    protected function _register_core_class_loaders()
786
-    {
787
-        // for PHP5.3 compat, we need to register any properties called here in a variable because `$this` cannot
788
-        // be used in a closure.
789
-        $request = &$this->request;
790
-        $response = &$this->response;
791
-        $legacy_request = &$this->legacy_request;
792
-        // $loader = &$this->loader;
793
-        $this->_class_loaders = array(
794
-            // load_core
795
-            'EE_Capabilities'                              => 'load_core',
796
-            'EE_Encryption'                                => 'load_core',
797
-            'EE_Front_Controller'                          => 'load_core',
798
-            'EE_Module_Request_Router'                     => 'load_core',
799
-            'EE_Registry'                                  => 'load_core',
800
-            'EE_Request'                                   => function () use (&$legacy_request) {
801
-                return $legacy_request;
802
-            },
803
-            'EventEspresso\core\services\request\Request'  => function () use (&$request) {
804
-                return $request;
805
-            },
806
-            'EventEspresso\core\services\request\Response' => function () use (&$response) {
807
-                return $response;
808
-            },
809
-            'EE_Base'                                      => 'load_core',
810
-            'EE_Request_Handler'                           => 'load_core',
811
-            'EE_Session'                                   => 'load_core',
812
-            'EE_Cron_Tasks'                                => 'load_core',
813
-            'EE_System'                                    => 'load_core',
814
-            'EE_Maintenance_Mode'                          => 'load_core',
815
-            'EE_Register_CPTs'                             => 'load_core',
816
-            'EE_Admin'                                     => 'load_core',
817
-            'EE_CPT_Strategy'                              => 'load_core',
818
-            // load_lib
819
-            'EE_Message_Resource_Manager'                  => 'load_lib',
820
-            'EE_Message_Type_Collection'                   => 'load_lib',
821
-            'EE_Message_Type_Collection_Loader'            => 'load_lib',
822
-            'EE_Messenger_Collection'                      => 'load_lib',
823
-            'EE_Messenger_Collection_Loader'               => 'load_lib',
824
-            'EE_Messages_Processor'                        => 'load_lib',
825
-            'EE_Message_Repository'                        => 'load_lib',
826
-            'EE_Messages_Queue'                            => 'load_lib',
827
-            'EE_Messages_Data_Handler_Collection'          => 'load_lib',
828
-            'EE_Message_Template_Group_Collection'         => 'load_lib',
829
-            'EE_Payment_Method_Manager'                    => 'load_lib',
830
-            'EE_Messages_Generator'                        => function () {
831
-                return EE_Registry::instance()->load_lib(
832
-                    'Messages_Generator',
833
-                    array(),
834
-                    false,
835
-                    false
836
-                );
837
-            },
838
-            'EE_Messages_Template_Defaults'                => function ($arguments = array()) {
839
-                return EE_Registry::instance()->load_lib(
840
-                    'Messages_Template_Defaults',
841
-                    $arguments,
842
-                    false,
843
-                    false
844
-                );
845
-            },
846
-            // load_helper
847
-            'EEH_Parse_Shortcodes'                         => function () {
848
-                if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
849
-                    return new EEH_Parse_Shortcodes();
850
-                }
851
-                return null;
852
-            },
853
-            'EE_Template_Config'                           => function () {
854
-                return EE_Config::instance()->template_settings;
855
-            },
856
-            'EE_Currency_Config'                           => function () {
857
-                return EE_Config::instance()->currency;
858
-            },
859
-            'EE_Registration_Config'                       => function () {
860
-                return EE_Config::instance()->registration;
861
-            },
862
-            'EE_Core_Config'                               => function () {
863
-                return EE_Config::instance()->core;
864
-            },
865
-            'EventEspresso\core\services\loaders\Loader'   => function () {
866
-                return LoaderFactory::getLoader();
867
-            },
868
-            'EE_Network_Config'                            => function () {
869
-                return EE_Network_Config::instance();
870
-            },
871
-            'EE_Config'                                    => function () {
872
-                return EE_Config::instance();
873
-            },
874
-            'EventEspresso\core\domain\Domain'             => function () {
875
-                return DomainFactory::getEventEspressoCoreDomain();
876
-            },
877
-        );
878
-    }
879
-
880
-
881
-    /**
882
-     * can be used for supplying alternate names for classes,
883
-     * or for connecting interface names to instantiable classes
884
-     */
885
-    protected function _register_core_aliases()
886
-    {
887
-        $aliases = array(
888
-            'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
889
-            'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
890
-            'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
891
-            'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
892
-            'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
893
-            'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
894
-            'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
895
-            'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
896
-            'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
897
-            'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
898
-            'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
899
-            'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
900
-            'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
901
-            'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
902
-            'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
903
-            'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
904
-            'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
905
-            'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
906
-            'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
907
-            'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
908
-            'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
909
-            'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
910
-            'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
911
-            'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
912
-            'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
913
-            'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
914
-            'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
915
-            'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
916
-            'EventEspresso\core\domain\services\session\SessionIdentifierInterface'        => 'EE_Session',
917
-            'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
918
-            'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
919
-            'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
920
-            'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
921
-            'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
922
-            'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
923
-            'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
924
-            'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
925
-            'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
926
-        );
927
-        foreach ($aliases as $alias => $fqn) {
928
-            if (is_array($fqn)) {
929
-                foreach ($fqn as $class => $for_class) {
930
-                    $this->class_cache->addAlias($class, $alias, $for_class);
931
-                }
932
-                continue;
933
-            }
934
-            $this->class_cache->addAlias($fqn, $alias);
935
-        }
936
-        if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
937
-            $this->class_cache->addAlias(
938
-                'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
939
-                'EventEspresso\core\services\notices\NoticeConverterInterface'
940
-            );
941
-        }
942
-    }
943
-
944
-
945
-    /**
946
-     * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
947
-     * request Primarily used by unit tests.
948
-     */
949
-    public function reset()
950
-    {
951
-        $this->_register_core_class_loaders();
952
-        $this->_register_core_dependencies();
953
-    }
954
-
955
-
956
-    /**
957
-     * PLZ NOTE: a better name for this method would be is_alias()
958
-     * because it returns TRUE if the provided fully qualified name IS an alias
959
-     * WHY?
960
-     * Because if a class is type hinting for a concretion,
961
-     * then why would we need to find another class to supply it?
962
-     * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
963
-     * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
964
-     * Don't go looking for some substitute.
965
-     * Whereas if a class is type hinting for an interface...
966
-     * then we need to find an actual class to use.
967
-     * So the interface IS the alias for some other FQN,
968
-     * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
969
-     * represents some other class.
970
-     *
971
-     * @deprecated $VID:$
972
-     * @param string $fqn
973
-     * @param string $for_class
974
-     * @return bool
975
-     */
976
-    public function has_alias($fqn = '', $for_class = '')
977
-    {
978
-        return $this->isAlias($fqn, $for_class);
979
-    }
980
-
981
-
982
-    /**
983
-     * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
984
-     * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
985
-     * functions recursively, so that multiple aliases can be used to drill down to a FQN
986
-     *  for example:
987
-     *      if the following two entries were added to the _aliases array:
988
-     *          array(
989
-     *              'interface_alias'           => 'some\namespace\interface'
990
-     *              'some\namespace\interface'  => 'some\namespace\classname'
991
-     *          )
992
-     *      then one could use EE_Registry::instance()->create( 'interface_alias' )
993
-     *      to load an instance of 'some\namespace\classname'
994
-     *
995
-     * @deprecated $VID:$
996
-     * @param string $alias
997
-     * @param string $for_class
998
-     * @return string
999
-     */
1000
-    public function get_alias($alias = '', $for_class = '')
1001
-    {
1002
-        return $this->getFqnForAlias($alias, $for_class);
1003
-    }
23
+	/**
24
+	 * This means that the requested class dependency is not present in the dependency map
25
+	 */
26
+	const not_registered = 0;
27
+
28
+	/**
29
+	 * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class.
30
+	 */
31
+	const load_new_object = 1;
32
+
33
+	/**
34
+	 * This instructs class loaders to return a previously instantiated and cached object for the requested class.
35
+	 * IF a previously instantiated object does not exist, a new one will be created and added to the cache.
36
+	 */
37
+	const load_from_cache = 2;
38
+
39
+	/**
40
+	 * When registering a dependency,
41
+	 * this indicates to keep any existing dependencies that already exist,
42
+	 * and simply discard any new dependencies declared in the incoming data
43
+	 */
44
+	const KEEP_EXISTING_DEPENDENCIES = 0;
45
+
46
+	/**
47
+	 * When registering a dependency,
48
+	 * this indicates to overwrite any existing dependencies that already exist using the incoming data
49
+	 */
50
+	const OVERWRITE_DEPENDENCIES = 1;
51
+
52
+
53
+	/**
54
+	 * @type EE_Dependency_Map $_instance
55
+	 */
56
+	protected static $_instance;
57
+
58
+	/**
59
+	 * @var ClassInterfaceCache $class_cache
60
+	 */
61
+	private $class_cache;
62
+
63
+	/**
64
+	 * @type RequestInterface $request
65
+	 */
66
+	protected $request;
67
+
68
+	/**
69
+	 * @type LegacyRequestInterface $legacy_request
70
+	 */
71
+	protected $legacy_request;
72
+
73
+	/**
74
+	 * @type ResponseInterface $response
75
+	 */
76
+	protected $response;
77
+
78
+	/**
79
+	 * @type LoaderInterface $loader
80
+	 */
81
+	protected $loader;
82
+
83
+	/**
84
+	 * @type array $_dependency_map
85
+	 */
86
+	protected $_dependency_map = array();
87
+
88
+	/**
89
+	 * @type array $_class_loaders
90
+	 */
91
+	protected $_class_loaders = array();
92
+
93
+
94
+	/**
95
+	 * EE_Dependency_Map constructor.
96
+	 *
97
+	 * @param ClassInterfaceCache $class_cache
98
+	 */
99
+	protected function __construct(ClassInterfaceCache $class_cache)
100
+	{
101
+		$this->class_cache = $class_cache;
102
+		do_action('EE_Dependency_Map____construct', $this);
103
+	}
104
+
105
+
106
+	/**
107
+	 * @return void
108
+	 */
109
+	public function initialize()
110
+	{
111
+		$this->_register_core_dependencies();
112
+		$this->_register_core_class_loaders();
113
+		$this->_register_core_aliases();
114
+	}
115
+
116
+
117
+	/**
118
+	 * @singleton method used to instantiate class object
119
+	 * @param ClassInterfaceCache|null $class_cache
120
+	 * @return EE_Dependency_Map
121
+	 */
122
+	public static function instance(ClassInterfaceCache $class_cache = null)
123
+	{
124
+		// check if class object is instantiated, and instantiated properly
125
+		if (! self::$_instance instanceof EE_Dependency_Map
126
+			&& $class_cache instanceof ClassInterfaceCache
127
+		) {
128
+			self::$_instance = new EE_Dependency_Map($class_cache);
129
+		}
130
+		return self::$_instance;
131
+	}
132
+
133
+
134
+	/**
135
+	 * @param RequestInterface $request
136
+	 */
137
+	public function setRequest(RequestInterface $request)
138
+	{
139
+		$this->request = $request;
140
+	}
141
+
142
+
143
+	/**
144
+	 * @param LegacyRequestInterface $legacy_request
145
+	 */
146
+	public function setLegacyRequest(LegacyRequestInterface $legacy_request)
147
+	{
148
+		$this->legacy_request = $legacy_request;
149
+	}
150
+
151
+
152
+	/**
153
+	 * @param ResponseInterface $response
154
+	 */
155
+	public function setResponse(ResponseInterface $response)
156
+	{
157
+		$this->response = $response;
158
+	}
159
+
160
+
161
+	/**
162
+	 * @param LoaderInterface $loader
163
+	 */
164
+	public function setLoader(LoaderInterface $loader)
165
+	{
166
+		$this->loader = $loader;
167
+	}
168
+
169
+
170
+	/**
171
+	 * @param string $class
172
+	 * @param array  $dependencies
173
+	 * @param int    $overwrite
174
+	 * @return bool
175
+	 */
176
+	public static function register_dependencies(
177
+		$class,
178
+		array $dependencies,
179
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
180
+	) {
181
+		return self::$_instance->registerDependencies($class, $dependencies, $overwrite);
182
+	}
183
+
184
+
185
+	/**
186
+	 * Assigns an array of class names and corresponding load sources (new or cached)
187
+	 * to the class specified by the first parameter.
188
+	 * IMPORTANT !!!
189
+	 * The order of elements in the incoming $dependencies array MUST match
190
+	 * the order of the constructor parameters for the class in question.
191
+	 * This is especially important when overriding any existing dependencies that are registered.
192
+	 * the third parameter controls whether any duplicate dependencies are overwritten or not.
193
+	 *
194
+	 * @param string $class
195
+	 * @param array  $dependencies
196
+	 * @param int    $overwrite
197
+	 * @return bool
198
+	 */
199
+	public function registerDependencies(
200
+		$class,
201
+		array $dependencies,
202
+		$overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES
203
+	) {
204
+		$class = trim($class, '\\');
205
+		$registered = false;
206
+		if (empty(self::$_instance->_dependency_map[ $class ])) {
207
+			self::$_instance->_dependency_map[ $class ] = array();
208
+		}
209
+		// we need to make sure that any aliases used when registering a dependency
210
+		// get resolved to the correct class name
211
+		foreach ($dependencies as $dependency => $load_source) {
212
+			$alias = self::$_instance->getFqnForAlias($dependency);
213
+			if ($overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES
214
+				|| ! isset(self::$_instance->_dependency_map[ $class ][ $alias ])
215
+			) {
216
+				unset($dependencies[ $dependency ]);
217
+				$dependencies[ $alias ] = $load_source;
218
+				$registered = true;
219
+			}
220
+		}
221
+		// now add our two lists of dependencies together.
222
+		// using Union (+=) favours the arrays in precedence from left to right,
223
+		// so $dependencies is NOT overwritten because it is listed first
224
+		// ie: with A = B + C, entries in B take precedence over duplicate entries in C
225
+		// Union is way faster than array_merge() but should be used with caution...
226
+		// especially with numerically indexed arrays
227
+		$dependencies += self::$_instance->_dependency_map[ $class ];
228
+		// now we need to ensure that the resulting dependencies
229
+		// array only has the entries that are required for the class
230
+		// so first count how many dependencies were originally registered for the class
231
+		$dependency_count = count(self::$_instance->_dependency_map[ $class ]);
232
+		// if that count is non-zero (meaning dependencies were already registered)
233
+		self::$_instance->_dependency_map[ $class ] = $dependency_count
234
+			// then truncate the  final array to match that count
235
+			? array_slice($dependencies, 0, $dependency_count)
236
+			// otherwise just take the incoming array because nothing previously existed
237
+			: $dependencies;
238
+		return $registered;
239
+	}
240
+
241
+
242
+	/**
243
+	 * @param string $class_name
244
+	 * @param string $loader
245
+	 * @return bool
246
+	 * @throws DomainException
247
+	 */
248
+	public static function register_class_loader($class_name, $loader = 'load_core')
249
+	{
250
+		if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) {
251
+			throw new DomainException(
252
+				esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso')
253
+			);
254
+		}
255
+		// check that loader is callable or method starts with "load_" and exists in EE_Registry
256
+		if (! is_callable($loader)
257
+			&& (
258
+				strpos($loader, 'load_') !== 0
259
+				|| ! method_exists('EE_Registry', $loader)
260
+			)
261
+		) {
262
+			throw new DomainException(
263
+				sprintf(
264
+					esc_html__(
265
+						'"%1$s" is not a valid loader method on EE_Registry.',
266
+						'event_espresso'
267
+					),
268
+					$loader
269
+				)
270
+			);
271
+		}
272
+		$class_name = self::$_instance->getFqnForAlias($class_name);
273
+		if (! isset(self::$_instance->_class_loaders[ $class_name ])) {
274
+			self::$_instance->_class_loaders[ $class_name ] = $loader;
275
+			return true;
276
+		}
277
+		return false;
278
+	}
279
+
280
+
281
+	/**
282
+	 * @return array
283
+	 */
284
+	public function dependency_map()
285
+	{
286
+		return $this->_dependency_map;
287
+	}
288
+
289
+
290
+	/**
291
+	 * returns TRUE if dependency map contains a listing for the provided class name
292
+	 *
293
+	 * @param string $class_name
294
+	 * @return boolean
295
+	 */
296
+	public function has($class_name = '')
297
+	{
298
+		// all legacy models have the same dependencies
299
+		if (strpos($class_name, 'EEM_') === 0) {
300
+			$class_name = 'LEGACY_MODELS';
301
+		}
302
+		return isset($this->_dependency_map[ $class_name ]) ? true : false;
303
+	}
304
+
305
+
306
+	/**
307
+	 * returns TRUE if dependency map contains a listing for the provided class name AND dependency
308
+	 *
309
+	 * @param string $class_name
310
+	 * @param string $dependency
311
+	 * @return bool
312
+	 */
313
+	public function has_dependency_for_class($class_name = '', $dependency = '')
314
+	{
315
+		// all legacy models have the same dependencies
316
+		if (strpos($class_name, 'EEM_') === 0) {
317
+			$class_name = 'LEGACY_MODELS';
318
+		}
319
+		$dependency = $this->getFqnForAlias($dependency, $class_name);
320
+		return isset($this->_dependency_map[ $class_name ][ $dependency ])
321
+			? true
322
+			: false;
323
+	}
324
+
325
+
326
+	/**
327
+	 * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned
328
+	 *
329
+	 * @param string $class_name
330
+	 * @param string $dependency
331
+	 * @return int
332
+	 */
333
+	public function loading_strategy_for_class_dependency($class_name = '', $dependency = '')
334
+	{
335
+		// all legacy models have the same dependencies
336
+		if (strpos($class_name, 'EEM_') === 0) {
337
+			$class_name = 'LEGACY_MODELS';
338
+		}
339
+		$dependency = $this->getFqnForAlias($dependency);
340
+		return $this->has_dependency_for_class($class_name, $dependency)
341
+			? $this->_dependency_map[ $class_name ][ $dependency ]
342
+			: EE_Dependency_Map::not_registered;
343
+	}
344
+
345
+
346
+	/**
347
+	 * @param string $class_name
348
+	 * @return string | Closure
349
+	 */
350
+	public function class_loader($class_name)
351
+	{
352
+		// all legacy models use load_model()
353
+		if (strpos($class_name, 'EEM_') === 0) {
354
+			return 'load_model';
355
+		}
356
+		$class_name = $this->getFqnForAlias($class_name);
357
+		return isset($this->_class_loaders[ $class_name ]) ? $this->_class_loaders[ $class_name ] : '';
358
+	}
359
+
360
+
361
+	/**
362
+	 * @return array
363
+	 */
364
+	public function class_loaders()
365
+	{
366
+		return $this->_class_loaders;
367
+	}
368
+
369
+
370
+	/**
371
+	 * adds an alias for a classname
372
+	 *
373
+	 * @param string $fqcn      the class name that should be used (concrete class to replace interface)
374
+	 * @param string $alias     the class name that would be type hinted for (abstract parent or interface)
375
+	 * @param string $for_class the class that has the dependency (is type hinting for the interface)
376
+	 */
377
+	public function add_alias($fqcn, $alias, $for_class = '')
378
+	{
379
+		$this->class_cache->addAlias($fqcn, $alias, $for_class);
380
+	}
381
+
382
+
383
+	/**
384
+	 * Returns TRUE if the provided fully qualified name IS an alias
385
+	 * WHY?
386
+	 * Because if a class is type hinting for a concretion,
387
+	 * then why would we need to find another class to supply it?
388
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
389
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
390
+	 * Don't go looking for some substitute.
391
+	 * Whereas if a class is type hinting for an interface...
392
+	 * then we need to find an actual class to use.
393
+	 * So the interface IS the alias for some other FQN,
394
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
395
+	 * represents some other class.
396
+	 *
397
+	 * @param string $fqn
398
+	 * @param string $for_class
399
+	 * @return bool
400
+	 */
401
+	public function isAlias($fqn = '', $for_class = '')
402
+	{
403
+		return $this->class_cache->isAlias($fqn, $for_class);
404
+	}
405
+
406
+
407
+	/**
408
+	 * Returns a FQN for provided alias if one exists, otherwise returns the original $alias
409
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
410
+	 *  for example:
411
+	 *      if the following two entries were added to the _aliases array:
412
+	 *          array(
413
+	 *              'interface_alias'           => 'some\namespace\interface'
414
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
415
+	 *          )
416
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
417
+	 *      to load an instance of 'some\namespace\classname'
418
+	 *
419
+	 * @param string $alias
420
+	 * @param string $for_class
421
+	 * @return string
422
+	 */
423
+	public function getFqnForAlias($alias = '', $for_class = '')
424
+	{
425
+		return (string) $this->class_cache->getFqnForAlias($alias, $for_class);
426
+	}
427
+
428
+
429
+	/**
430
+	 * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache,
431
+	 * if one exists, or whether a new object should be generated every time the requested class is loaded.
432
+	 * This is done by using the following class constants:
433
+	 *        EE_Dependency_Map::load_from_cache - loads previously instantiated object
434
+	 *        EE_Dependency_Map::load_new_object - generates a new object every time
435
+	 */
436
+	protected function _register_core_dependencies()
437
+	{
438
+		$this->_dependency_map = array(
439
+			'EE_Request_Handler'                                                                                          => array(
440
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
441
+			),
442
+			'EE_System'                                                                                                   => array(
443
+				'EE_Registry'                                 => EE_Dependency_Map::load_from_cache,
444
+				'EventEspresso\core\services\loaders\Loader'  => EE_Dependency_Map::load_from_cache,
445
+				'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache,
446
+				'EE_Maintenance_Mode'                         => EE_Dependency_Map::load_from_cache,
447
+			),
448
+			'EE_Session'                                                                                                  => array(
449
+				'EventEspresso\core\services\cache\TransientCacheStorage'  => EE_Dependency_Map::load_from_cache,
450
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
451
+				'EventEspresso\core\services\request\Request'              => EE_Dependency_Map::load_from_cache,
452
+				'EE_Encryption'                                            => EE_Dependency_Map::load_from_cache,
453
+			),
454
+			'EE_Cart'                                                                                                     => array(
455
+				'EE_Session' => EE_Dependency_Map::load_from_cache,
456
+			),
457
+			'EE_Front_Controller'                                                                                         => array(
458
+				'EE_Registry'              => EE_Dependency_Map::load_from_cache,
459
+				'EE_Request_Handler'       => EE_Dependency_Map::load_from_cache,
460
+				'EE_Module_Request_Router' => EE_Dependency_Map::load_from_cache,
461
+			),
462
+			'EE_Messenger_Collection_Loader'                                                                              => array(
463
+				'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object,
464
+			),
465
+			'EE_Message_Type_Collection_Loader'                                                                           => array(
466
+				'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object,
467
+			),
468
+			'EE_Message_Resource_Manager'                                                                                 => array(
469
+				'EE_Messenger_Collection_Loader'    => EE_Dependency_Map::load_new_object,
470
+				'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object,
471
+				'EEM_Message_Template_Group'        => EE_Dependency_Map::load_from_cache,
472
+			),
473
+			'EE_Message_Factory'                                                                                          => array(
474
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
475
+			),
476
+			'EE_messages'                                                                                                 => array(
477
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
478
+			),
479
+			'EE_Messages_Generator'                                                                                       => array(
480
+				'EE_Messages_Queue'                    => EE_Dependency_Map::load_new_object,
481
+				'EE_Messages_Data_Handler_Collection'  => EE_Dependency_Map::load_new_object,
482
+				'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object,
483
+				'EEH_Parse_Shortcodes'                 => EE_Dependency_Map::load_from_cache,
484
+			),
485
+			'EE_Messages_Processor'                                                                                       => array(
486
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
487
+			),
488
+			'EE_Messages_Queue'                                                                                           => array(
489
+				'EE_Message_Repository' => EE_Dependency_Map::load_new_object,
490
+			),
491
+			'EE_Messages_Template_Defaults'                                                                               => array(
492
+				'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache,
493
+				'EEM_Message_Template'       => EE_Dependency_Map::load_from_cache,
494
+			),
495
+			'EE_Message_To_Generate_From_Request'                                                                         => array(
496
+				'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache,
497
+				'EE_Request_Handler'          => EE_Dependency_Map::load_from_cache,
498
+			),
499
+			'EventEspresso\core\services\commands\CommandBus'                                                             => array(
500
+				'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache,
501
+			),
502
+			'EventEspresso\services\commands\CommandHandler'                                                              => array(
503
+				'EE_Registry'         => EE_Dependency_Map::load_from_cache,
504
+				'CommandBusInterface' => EE_Dependency_Map::load_from_cache,
505
+			),
506
+			'EventEspresso\core\services\commands\CommandHandlerManager'                                                  => array(
507
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
508
+			),
509
+			'EventEspresso\core\services\commands\CompositeCommandHandler'                                                => array(
510
+				'EventEspresso\core\services\commands\CommandBus'     => EE_Dependency_Map::load_from_cache,
511
+				'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache,
512
+			),
513
+			'EventEspresso\core\services\commands\CommandFactory'                                                         => array(
514
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
515
+			),
516
+			'EventEspresso\core\services\commands\middleware\CapChecker'                                                  => array(
517
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
518
+			),
519
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker'                                         => array(
520
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
521
+			),
522
+			'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker'                                     => array(
523
+				'EE_Capabilities' => EE_Dependency_Map::load_from_cache,
524
+			),
525
+			'EventEspresso\core\services\commands\registration\CreateRegistrationCommandHandler'                          => array(
526
+				'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache,
527
+			),
528
+			'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommandHandler'                     => array(
529
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
530
+			),
531
+			'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommandHandler'                    => array(
532
+				'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache,
533
+			),
534
+			'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler'         => array(
535
+				'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
536
+			),
537
+			'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => array(
538
+				'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache,
539
+			),
540
+			'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler'                              => array(
541
+				'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache,
542
+			),
543
+			'EventEspresso\core\services\commands\ticket\CancelTicketLineItemCommandHandler'                              => array(
544
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
545
+			),
546
+			'EventEspresso\core\domain\services\registration\CancelRegistrationService'                                   => array(
547
+				'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache,
548
+			),
549
+			'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler'                                  => array(
550
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
551
+			),
552
+			'EventEspresso\core\services\database\TableManager'                                                           => array(
553
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
554
+			),
555
+			'EE_Data_Migration_Class_Base'                                                                                => array(
556
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
557
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
558
+			),
559
+			'EE_DMS_Core_4_1_0'                                                                                           => array(
560
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
561
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
562
+			),
563
+			'EE_DMS_Core_4_2_0'                                                                                           => array(
564
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
565
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
566
+			),
567
+			'EE_DMS_Core_4_3_0'                                                                                           => array(
568
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
569
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
570
+			),
571
+			'EE_DMS_Core_4_4_0'                                                                                           => array(
572
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
573
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
574
+			),
575
+			'EE_DMS_Core_4_5_0'                                                                                           => array(
576
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
577
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
578
+			),
579
+			'EE_DMS_Core_4_6_0'                                                                                           => array(
580
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
581
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
582
+			),
583
+			'EE_DMS_Core_4_7_0'                                                                                           => array(
584
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
585
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
586
+			),
587
+			'EE_DMS_Core_4_8_0'                                                                                           => array(
588
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
589
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
590
+			),
591
+			'EE_DMS_Core_4_9_0'                                                                                           => array(
592
+				'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache,
593
+				'EventEspresso\core\services\database\TableManager'  => EE_Dependency_Map::load_from_cache,
594
+			),
595
+			'EventEspresso\core\services\assets\I18nRegistry'                                                             => array(
596
+				array(),
597
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
598
+			),
599
+			'EventEspresso\core\services\assets\Registry'                                                                 => array(
600
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
601
+				'EventEspresso\core\services\assets\I18nRegistry'    => EE_Dependency_Map::load_from_cache,
602
+			),
603
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled'                                             => array(
604
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
605
+			),
606
+			'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout'                                              => array(
607
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
608
+			),
609
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees'                                        => array(
610
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
611
+			),
612
+			'EventEspresso\core\domain\entities\shortcodes\EspressoEvents'                                                => array(
613
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
614
+			),
615
+			'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou'                                              => array(
616
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
617
+			),
618
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector'                                        => array(
619
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
620
+			),
621
+			'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage'                                               => array(
622
+				'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache,
623
+			),
624
+			'EventEspresso\core\services\cache\BasicCacheManager'                                                         => array(
625
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
626
+			),
627
+			'EventEspresso\core\services\cache\PostRelatedCacheManager'                                                   => array(
628
+				'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache,
629
+			),
630
+			'EventEspresso\core\domain\services\validation\email\EmailValidationService'                                  => array(
631
+				'EE_Registration_Config'                     => EE_Dependency_Map::load_from_cache,
632
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
633
+			),
634
+			'EventEspresso\core\domain\values\EmailAddress'                                                               => array(
635
+				null,
636
+				'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache,
637
+			),
638
+			'EventEspresso\core\services\orm\ModelFieldFactory'                                                           => array(
639
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
640
+			),
641
+			'LEGACY_MODELS'                                                                                               => array(
642
+				null,
643
+				'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache,
644
+			),
645
+			'EE_Module_Request_Router'                                                                                    => array(
646
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
647
+			),
648
+			'EE_Registration_Processor'                                                                                   => array(
649
+				'EE_Request' => EE_Dependency_Map::load_from_cache,
650
+			),
651
+			'EventEspresso\core\services\notifications\PersistentAdminNoticeManager'                                      => array(
652
+				null,
653
+				'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache,
654
+				'EE_Request'                                                          => EE_Dependency_Map::load_from_cache,
655
+			),
656
+			'EventEspresso\core\services\licensing\LicenseService'                                                        => array(
657
+				'EventEspresso\core\domain\services\pue\Stats'  => EE_Dependency_Map::load_from_cache,
658
+				'EventEspresso\core\domain\services\pue\Config' => EE_Dependency_Map::load_from_cache,
659
+			),
660
+			'EE_Admin_Transactions_List_Table'                                                                            => array(
661
+				null,
662
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache,
663
+			),
664
+			'EventEspresso\core\domain\services\pue\Stats'                                                                => array(
665
+				'EventEspresso\core\domain\services\pue\Config'        => EE_Dependency_Map::load_from_cache,
666
+				'EE_Maintenance_Mode'                                  => EE_Dependency_Map::load_from_cache,
667
+				'EventEspresso\core\domain\services\pue\StatsGatherer' => EE_Dependency_Map::load_from_cache,
668
+			),
669
+			'EventEspresso\core\domain\services\pue\Config'                                                               => array(
670
+				'EE_Network_Config' => EE_Dependency_Map::load_from_cache,
671
+				'EE_Config'         => EE_Dependency_Map::load_from_cache,
672
+			),
673
+			'EventEspresso\core\domain\services\pue\StatsGatherer'                                                        => array(
674
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
675
+				'EEM_Event'          => EE_Dependency_Map::load_from_cache,
676
+				'EEM_Datetime'       => EE_Dependency_Map::load_from_cache,
677
+				'EEM_Ticket'         => EE_Dependency_Map::load_from_cache,
678
+				'EEM_Registration'   => EE_Dependency_Map::load_from_cache,
679
+				'EEM_Transaction'    => EE_Dependency_Map::load_from_cache,
680
+				'EE_Config'          => EE_Dependency_Map::load_from_cache,
681
+			),
682
+			'EventEspresso\core\domain\services\admin\ExitModal'                                                          => array(
683
+				'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
684
+			),
685
+			'EventEspresso\core\domain\services\admin\PluginUpsells'                                                      => array(
686
+				'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache,
687
+			),
688
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha'                                    => array(
689
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
690
+				'EE_Session'             => EE_Dependency_Map::load_from_cache,
691
+			),
692
+			'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings'                                => array(
693
+				'EE_Registration_Config' => EE_Dependency_Map::load_from_cache,
694
+			),
695
+			'EventEspresso\modules\ticket_selector\ProcessTicketSelector'                                                 => array(
696
+				'EE_Core_Config'                                                          => EE_Dependency_Map::load_from_cache,
697
+				'EventEspresso\core\services\request\Request'                             => EE_Dependency_Map::load_from_cache,
698
+				'EE_Session'                                                              => EE_Dependency_Map::load_from_cache,
699
+				'EEM_Ticket'                                                              => EE_Dependency_Map::load_from_cache,
700
+				'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache,
701
+			),
702
+			'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker'                                     => array(
703
+				'EEM_Datetime' => EE_Dependency_Map::load_from_cache,
704
+			),
705
+			'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions'                              => array(
706
+				'EE_Core_Config'                             => EE_Dependency_Map::load_from_cache,
707
+				'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache,
708
+			),
709
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes'                                => array(
710
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
711
+			),
712
+			'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies'                               => array(
713
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
714
+			),
715
+			'EE_CPT_Strategy'                                                                                             => array(
716
+				'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache,
717
+				'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache,
718
+			),
719
+			'EventEspresso\core\services\loaders\ObjectIdentifier'                                                        => array(
720
+				'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache,
721
+			),
722
+			'EventEspresso\core\domain\entities\editor\blocks\CoreBlocksAssetManager'                                     => array(
723
+				'EventEspresso\core\domain\Domain'            => EE_Dependency_Map::load_from_cache,
724
+				'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache,
725
+			),
726
+			'EventEspresso\core\services\assets\AssetManager'                                                             => array(
727
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
728
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
729
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
730
+			),
731
+			'EventEspresso\core\domain\services\assets\CoreAssetManager'                                                  => array(
732
+				'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache,
733
+				'EE_Currency_Config'                                 => EE_Dependency_Map::load_from_cache,
734
+				'EE_Template_Config'                                 => EE_Dependency_Map::load_from_cache,
735
+				'EventEspresso\core\domain\Domain'                   => EE_Dependency_Map::load_from_cache,
736
+				'EventEspresso\core\services\assets\Registry'        => EE_Dependency_Map::load_from_cache,
737
+			),
738
+			'EventEspresso\core\domain\services\admin\privacy\policy\PrivacyPolicy' => array(
739
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache,
740
+				'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache
741
+			),
742
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendee' => array(
743
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
744
+			),
745
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportAttendeeBillingData' => array(
746
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
747
+				'EEM_Payment_Method' => EE_Dependency_Map::load_from_cache
748
+			),
749
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportCheckins' => array(
750
+				'EEM_Checkin' => EE_Dependency_Map::load_from_cache,
751
+			),
752
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportRegistration' => array(
753
+				'EEM_Registration' => EE_Dependency_Map::load_from_cache,
754
+			),
755
+			'EventEspresso\core\domain\services\admin\privacy\export\ExportTransaction' => array(
756
+				'EEM_Transaction' => EE_Dependency_Map::load_from_cache,
757
+			),
758
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAttendeeData' => array(
759
+				'EEM_Attendee' => EE_Dependency_Map::load_from_cache,
760
+			),
761
+			'EventEspresso\core\domain\services\admin\privacy\erasure\EraseAnswers' => array(
762
+				'EEM_Answer' => EE_Dependency_Map::load_from_cache,
763
+				'EEM_Question' => EE_Dependency_Map::load_from_cache,
764
+			),
765
+		);
766
+	}
767
+
768
+
769
+	/**
770
+	 * Registers how core classes are loaded.
771
+	 * This can either be done by simply providing the name of one of the EE_Registry loader methods such as:
772
+	 *        'EE_Request_Handler' => 'load_core'
773
+	 *        'EE_Messages_Queue'  => 'load_lib'
774
+	 *        'EEH_Debug_Tools'    => 'load_helper'
775
+	 * or, if greater control is required, by providing a custom closure. For example:
776
+	 *        'Some_Class' => function () {
777
+	 *            return new Some_Class();
778
+	 *        },
779
+	 * This is required for instantiating dependencies
780
+	 * where an interface has been type hinted in a class constructor. For example:
781
+	 *        'Required_Interface' => function () {
782
+	 *            return new A_Class_That_Implements_Required_Interface();
783
+	 *        },
784
+	 */
785
+	protected function _register_core_class_loaders()
786
+	{
787
+		// for PHP5.3 compat, we need to register any properties called here in a variable because `$this` cannot
788
+		// be used in a closure.
789
+		$request = &$this->request;
790
+		$response = &$this->response;
791
+		$legacy_request = &$this->legacy_request;
792
+		// $loader = &$this->loader;
793
+		$this->_class_loaders = array(
794
+			// load_core
795
+			'EE_Capabilities'                              => 'load_core',
796
+			'EE_Encryption'                                => 'load_core',
797
+			'EE_Front_Controller'                          => 'load_core',
798
+			'EE_Module_Request_Router'                     => 'load_core',
799
+			'EE_Registry'                                  => 'load_core',
800
+			'EE_Request'                                   => function () use (&$legacy_request) {
801
+				return $legacy_request;
802
+			},
803
+			'EventEspresso\core\services\request\Request'  => function () use (&$request) {
804
+				return $request;
805
+			},
806
+			'EventEspresso\core\services\request\Response' => function () use (&$response) {
807
+				return $response;
808
+			},
809
+			'EE_Base'                                      => 'load_core',
810
+			'EE_Request_Handler'                           => 'load_core',
811
+			'EE_Session'                                   => 'load_core',
812
+			'EE_Cron_Tasks'                                => 'load_core',
813
+			'EE_System'                                    => 'load_core',
814
+			'EE_Maintenance_Mode'                          => 'load_core',
815
+			'EE_Register_CPTs'                             => 'load_core',
816
+			'EE_Admin'                                     => 'load_core',
817
+			'EE_CPT_Strategy'                              => 'load_core',
818
+			// load_lib
819
+			'EE_Message_Resource_Manager'                  => 'load_lib',
820
+			'EE_Message_Type_Collection'                   => 'load_lib',
821
+			'EE_Message_Type_Collection_Loader'            => 'load_lib',
822
+			'EE_Messenger_Collection'                      => 'load_lib',
823
+			'EE_Messenger_Collection_Loader'               => 'load_lib',
824
+			'EE_Messages_Processor'                        => 'load_lib',
825
+			'EE_Message_Repository'                        => 'load_lib',
826
+			'EE_Messages_Queue'                            => 'load_lib',
827
+			'EE_Messages_Data_Handler_Collection'          => 'load_lib',
828
+			'EE_Message_Template_Group_Collection'         => 'load_lib',
829
+			'EE_Payment_Method_Manager'                    => 'load_lib',
830
+			'EE_Messages_Generator'                        => function () {
831
+				return EE_Registry::instance()->load_lib(
832
+					'Messages_Generator',
833
+					array(),
834
+					false,
835
+					false
836
+				);
837
+			},
838
+			'EE_Messages_Template_Defaults'                => function ($arguments = array()) {
839
+				return EE_Registry::instance()->load_lib(
840
+					'Messages_Template_Defaults',
841
+					$arguments,
842
+					false,
843
+					false
844
+				);
845
+			},
846
+			// load_helper
847
+			'EEH_Parse_Shortcodes'                         => function () {
848
+				if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) {
849
+					return new EEH_Parse_Shortcodes();
850
+				}
851
+				return null;
852
+			},
853
+			'EE_Template_Config'                           => function () {
854
+				return EE_Config::instance()->template_settings;
855
+			},
856
+			'EE_Currency_Config'                           => function () {
857
+				return EE_Config::instance()->currency;
858
+			},
859
+			'EE_Registration_Config'                       => function () {
860
+				return EE_Config::instance()->registration;
861
+			},
862
+			'EE_Core_Config'                               => function () {
863
+				return EE_Config::instance()->core;
864
+			},
865
+			'EventEspresso\core\services\loaders\Loader'   => function () {
866
+				return LoaderFactory::getLoader();
867
+			},
868
+			'EE_Network_Config'                            => function () {
869
+				return EE_Network_Config::instance();
870
+			},
871
+			'EE_Config'                                    => function () {
872
+				return EE_Config::instance();
873
+			},
874
+			'EventEspresso\core\domain\Domain'             => function () {
875
+				return DomainFactory::getEventEspressoCoreDomain();
876
+			},
877
+		);
878
+	}
879
+
880
+
881
+	/**
882
+	 * can be used for supplying alternate names for classes,
883
+	 * or for connecting interface names to instantiable classes
884
+	 */
885
+	protected function _register_core_aliases()
886
+	{
887
+		$aliases = array(
888
+			'CommandBusInterface'                                                          => 'EventEspresso\core\services\commands\CommandBusInterface',
889
+			'EventEspresso\core\services\commands\CommandBusInterface'                     => 'EventEspresso\core\services\commands\CommandBus',
890
+			'CommandHandlerManagerInterface'                                               => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface',
891
+			'EventEspresso\core\services\commands\CommandHandlerManagerInterface'          => 'EventEspresso\core\services\commands\CommandHandlerManager',
892
+			'CapChecker'                                                                   => 'EventEspresso\core\services\commands\middleware\CapChecker',
893
+			'AddActionHook'                                                                => 'EventEspresso\core\services\commands\middleware\AddActionHook',
894
+			'CapabilitiesChecker'                                                          => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
895
+			'CapabilitiesCheckerInterface'                                                 => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface',
896
+			'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker',
897
+			'CreateRegistrationService'                                                    => 'EventEspresso\core\domain\services\registration\CreateRegistrationService',
898
+			'CreateRegistrationCommandHandler'                                             => 'EventEspresso\core\services\commands\registration\CreateRegistrationCommand',
899
+			'CopyRegistrationDetailsCommandHandler'                                        => 'EventEspresso\core\services\commands\registration\CopyRegistrationDetailsCommand',
900
+			'CopyRegistrationPaymentsCommandHandler'                                       => 'EventEspresso\core\services\commands\registration\CopyRegistrationPaymentsCommand',
901
+			'CancelRegistrationAndTicketLineItemCommandHandler'                            => 'EventEspresso\core\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler',
902
+			'UpdateRegistrationAndTransactionAfterChangeCommandHandler'                    => 'EventEspresso\core\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler',
903
+			'CreateTicketLineItemCommandHandler'                                           => 'EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommand',
904
+			'CreateTransactionCommandHandler'                                              => 'EventEspresso\core\services\commands\transaction\CreateTransactionCommandHandler',
905
+			'CreateAttendeeCommandHandler'                                                 => 'EventEspresso\core\services\commands\attendee\CreateAttendeeCommandHandler',
906
+			'TableManager'                                                                 => 'EventEspresso\core\services\database\TableManager',
907
+			'TableAnalysis'                                                                => 'EventEspresso\core\services\database\TableAnalysis',
908
+			'EspressoShortcode'                                                            => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
909
+			'ShortcodeInterface'                                                           => 'EventEspresso\core\services\shortcodes\ShortcodeInterface',
910
+			'EventEspresso\core\services\shortcodes\ShortcodeInterface'                    => 'EventEspresso\core\services\shortcodes\EspressoShortcode',
911
+			'EventEspresso\core\services\cache\CacheStorageInterface'                      => 'EventEspresso\core\services\cache\TransientCacheStorage',
912
+			'LoaderInterface'                                                              => 'EventEspresso\core\services\loaders\LoaderInterface',
913
+			'EventEspresso\core\services\loaders\LoaderInterface'                          => 'EventEspresso\core\services\loaders\Loader',
914
+			'CommandFactoryInterface'                                                      => 'EventEspresso\core\services\commands\CommandFactoryInterface',
915
+			'EventEspresso\core\services\commands\CommandFactoryInterface'                 => 'EventEspresso\core\services\commands\CommandFactory',
916
+			'EventEspresso\core\domain\services\session\SessionIdentifierInterface'        => 'EE_Session',
917
+			'EmailValidatorInterface'                                                      => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface',
918
+			'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface'  => 'EventEspresso\core\domain\services\validation\email\EmailValidationService',
919
+			'NoticeConverterInterface'                                                     => 'EventEspresso\core\services\notices\NoticeConverterInterface',
920
+			'EventEspresso\core\services\notices\NoticeConverterInterface'                 => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors',
921
+			'NoticesContainerInterface'                                                    => 'EventEspresso\core\services\notices\NoticesContainerInterface',
922
+			'EventEspresso\core\services\notices\NoticesContainerInterface'                => 'EventEspresso\core\services\notices\NoticesContainer',
923
+			'EventEspresso\core\services\request\RequestInterface'                         => 'EventEspresso\core\services\request\Request',
924
+			'EventEspresso\core\services\request\ResponseInterface'                        => 'EventEspresso\core\services\request\Response',
925
+			'EventEspresso\core\domain\DomainInterface'                                    => 'EventEspresso\core\domain\Domain',
926
+		);
927
+		foreach ($aliases as $alias => $fqn) {
928
+			if (is_array($fqn)) {
929
+				foreach ($fqn as $class => $for_class) {
930
+					$this->class_cache->addAlias($class, $alias, $for_class);
931
+				}
932
+				continue;
933
+			}
934
+			$this->class_cache->addAlias($fqn, $alias);
935
+		}
936
+		if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) {
937
+			$this->class_cache->addAlias(
938
+				'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices',
939
+				'EventEspresso\core\services\notices\NoticeConverterInterface'
940
+			);
941
+		}
942
+	}
943
+
944
+
945
+	/**
946
+	 * This is used to reset the internal map and class_loaders to their original default state at the beginning of the
947
+	 * request Primarily used by unit tests.
948
+	 */
949
+	public function reset()
950
+	{
951
+		$this->_register_core_class_loaders();
952
+		$this->_register_core_dependencies();
953
+	}
954
+
955
+
956
+	/**
957
+	 * PLZ NOTE: a better name for this method would be is_alias()
958
+	 * because it returns TRUE if the provided fully qualified name IS an alias
959
+	 * WHY?
960
+	 * Because if a class is type hinting for a concretion,
961
+	 * then why would we need to find another class to supply it?
962
+	 * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`,
963
+	 * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`.
964
+	 * Don't go looking for some substitute.
965
+	 * Whereas if a class is type hinting for an interface...
966
+	 * then we need to find an actual class to use.
967
+	 * So the interface IS the alias for some other FQN,
968
+	 * and we need to find out if `Fully/Qualified/Namespace/SomeInterface`
969
+	 * represents some other class.
970
+	 *
971
+	 * @deprecated $VID:$
972
+	 * @param string $fqn
973
+	 * @param string $for_class
974
+	 * @return bool
975
+	 */
976
+	public function has_alias($fqn = '', $for_class = '')
977
+	{
978
+		return $this->isAlias($fqn, $for_class);
979
+	}
980
+
981
+
982
+	/**
983
+	 * PLZ NOTE: a better name for this method would be get_fqn_for_alias()
984
+	 * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias
985
+	 * functions recursively, so that multiple aliases can be used to drill down to a FQN
986
+	 *  for example:
987
+	 *      if the following two entries were added to the _aliases array:
988
+	 *          array(
989
+	 *              'interface_alias'           => 'some\namespace\interface'
990
+	 *              'some\namespace\interface'  => 'some\namespace\classname'
991
+	 *          )
992
+	 *      then one could use EE_Registry::instance()->create( 'interface_alias' )
993
+	 *      to load an instance of 'some\namespace\classname'
994
+	 *
995
+	 * @deprecated $VID:$
996
+	 * @param string $alias
997
+	 * @param string $for_class
998
+	 * @return string
999
+	 */
1000
+	public function get_alias($alias = '', $for_class = '')
1001
+	{
1002
+		return $this->getFqnForAlias($alias, $for_class);
1003
+	}
1004 1004
 }
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -38,103 +38,103 @@
 block discarded – undo
38 38
  * @since           4.0
39 39
  */
40 40
 if (function_exists('espresso_version')) {
41
-    if (! function_exists('espresso_duplicate_plugin_error')) {
42
-        /**
43
-         *    espresso_duplicate_plugin_error
44
-         *    displays if more than one version of EE is activated at the same time
45
-         */
46
-        function espresso_duplicate_plugin_error()
47
-        {
48
-            ?>
41
+	if (! function_exists('espresso_duplicate_plugin_error')) {
42
+		/**
43
+		 *    espresso_duplicate_plugin_error
44
+		 *    displays if more than one version of EE is activated at the same time
45
+		 */
46
+		function espresso_duplicate_plugin_error()
47
+		{
48
+			?>
49 49
             <div class="error">
50 50
                 <p>
51 51
                     <?php
52
-                    echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                    ); ?>
52
+					echo esc_html__(
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+					); ?>
56 56
                 </p>
57 57
             </div>
58 58
             <?php
59
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-        }
61
-    }
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+		}
61
+	}
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
-    if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.4.0');
65
+	if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                        esc_html__(
79
-                            'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                            'event_espresso'
81
-                        ),
82
-                        EE_MIN_PHP_VER_REQUIRED,
83
-                        PHP_VERSION,
84
-                        '<br/>',
85
-                        '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+						esc_html__(
79
+							'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+							'event_espresso'
81
+						),
82
+						EE_MIN_PHP_VER_REQUIRED,
83
+						PHP_VERSION,
84
+						'<br/>',
85
+						'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
-        /**
98
-         * espresso_version
99
-         * Returns the plugin version
100
-         *
101
-         * @return string
102
-         */
103
-        function espresso_version()
104
-        {
105
-            return apply_filters('FHEE__espresso__espresso_version', '4.9.62.rc.063');
106
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
+		/**
98
+		 * espresso_version
99
+		 * Returns the plugin version
100
+		 *
101
+		 * @return string
102
+		 */
103
+		function espresso_version()
104
+		{
105
+			return apply_filters('FHEE__espresso__espresso_version', '4.9.62.rc.063');
106
+		}
107 107
 
108
-        /**
109
-         * espresso_plugin_activation
110
-         * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
-         */
112
-        function espresso_plugin_activation()
113
-        {
114
-            update_option('ee_espresso_activation', true);
115
-        }
108
+		/**
109
+		 * espresso_plugin_activation
110
+		 * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
+		 */
112
+		function espresso_plugin_activation()
113
+		{
114
+			update_option('ee_espresso_activation', true);
115
+		}
116 116
 
117
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
117
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
118 118
 
119
-        require_once __DIR__ . '/core/bootstrap_espresso.php';
120
-        bootstrap_espresso();
121
-    }
119
+		require_once __DIR__ . '/core/bootstrap_espresso.php';
120
+		bootstrap_espresso();
121
+	}
122 122
 }
123 123
 if (! function_exists('espresso_deactivate_plugin')) {
124
-    /**
125
-     *    deactivate_plugin
126
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
-     *
128
-     * @access public
129
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
-     * @return    void
131
-     */
132
-    function espresso_deactivate_plugin($plugin_basename = '')
133
-    {
134
-        if (! function_exists('deactivate_plugins')) {
135
-            require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
-        }
137
-        unset($_GET['activate'], $_REQUEST['activate']);
138
-        deactivate_plugins($plugin_basename);
139
-    }
124
+	/**
125
+	 *    deactivate_plugin
126
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
+	 *
128
+	 * @access public
129
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
+	 * @return    void
131
+	 */
132
+	function espresso_deactivate_plugin($plugin_basename = '')
133
+	{
134
+		if (! function_exists('deactivate_plugins')) {
135
+			require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+		}
137
+		unset($_GET['activate'], $_REQUEST['activate']);
138
+		deactivate_plugins($plugin_basename);
139
+	}
140 140
 }
Please login to merge, or discard this patch.
form_sections/strategies/display/EE_Checkbox_Display_Strategy.strategy.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -12,60 +12,60 @@
 block discarded – undo
12 12
 class EE_Checkbox_Display_Strategy extends EE_Compound_Input_Display_Strategy
13 13
 {
14 14
 
15
-    /**
16
-     * @throws EE_Error
17
-     * @return string of html to display the field
18
-     */
19
-    public function display()
20
-    {
21
-        $input = $this->get_input();
22
-        $input->set_label_sizes();
23
-        $label_size_class = $input->get_label_size_class();
24
-        $html = '';
25
-        if (! is_array($input->raw_value()) && $input->raw_value() !== null) {
26
-            EE_Error::doing_it_wrong(
27
-                'EE_Checkbox_Display_Strategy::display()',
28
-                sprintf(
29
-                    esc_html_x(
30
-                        'Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"',
31
-                        'Input values for checkboxes should be an array of values, but the value for input "form-input-id" is "form-input-value". Please verify that the input name is exactly "form_input_name[]"',
32
-                        'event_espresso'
33
-                    ),
34
-                    $input->html_id(),
35
-                    var_export($input->raw_value(), true),
36
-                    $input->html_name() . '[]'
37
-                ),
38
-                '4.8.1'
39
-            );
40
-        }
41
-        $input_raw_value = (array) $input->raw_value();
42
-        foreach ($input->options() as $value => $display_text) {
43
-            $value = $input->get_normalization_strategy()->unnormalize_one($value);
44
-            $html_id = $this->get_sub_input_id($value);
45
-            $html .= EEH_HTML::nl(0, 'checkbox');
46
-            $html .= '<label for="'
47
-                     . $html_id
48
-                     . '" id="'
49
-                     . $html_id
50
-                     . '-lbl" class="ee-checkbox-label-after'
51
-                     . $label_size_class
52
-                     . '">';
53
-            $html .= EEH_HTML::nl(1, 'checkbox');
54
-            $html .= '<input type="checkbox"';
55
-            $html .= ' name="' . $input->html_name() . '[]"';
56
-            $html .= ' id="' . $html_id . '"';
57
-            $html .= ' class="' . $input->html_class() . '"';
58
-            $html .= ' style="' . $input->html_style() . '"';
59
-            $html .= ' value="' . esc_attr($value) . '"';
60
-            $html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true)
61
-                ? ' checked="checked"'
62
-                : '';
63
-            $html .= ' ' . $this->_input->other_html_attributes();
64
-            $html .= ' data-question_label="' . $input->html_label_id() . '"';
65
-            $html .= '>&nbsp;';
66
-            $html .= $display_text;
67
-            $html .= EEH_HTML::nl(-1, 'checkbox') . '</label>';
68
-        }
69
-        return $html;
70
-    }
15
+	/**
16
+	 * @throws EE_Error
17
+	 * @return string of html to display the field
18
+	 */
19
+	public function display()
20
+	{
21
+		$input = $this->get_input();
22
+		$input->set_label_sizes();
23
+		$label_size_class = $input->get_label_size_class();
24
+		$html = '';
25
+		if (! is_array($input->raw_value()) && $input->raw_value() !== null) {
26
+			EE_Error::doing_it_wrong(
27
+				'EE_Checkbox_Display_Strategy::display()',
28
+				sprintf(
29
+					esc_html_x(
30
+						'Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"',
31
+						'Input values for checkboxes should be an array of values, but the value for input "form-input-id" is "form-input-value". Please verify that the input name is exactly "form_input_name[]"',
32
+						'event_espresso'
33
+					),
34
+					$input->html_id(),
35
+					var_export($input->raw_value(), true),
36
+					$input->html_name() . '[]'
37
+				),
38
+				'4.8.1'
39
+			);
40
+		}
41
+		$input_raw_value = (array) $input->raw_value();
42
+		foreach ($input->options() as $value => $display_text) {
43
+			$value = $input->get_normalization_strategy()->unnormalize_one($value);
44
+			$html_id = $this->get_sub_input_id($value);
45
+			$html .= EEH_HTML::nl(0, 'checkbox');
46
+			$html .= '<label for="'
47
+					 . $html_id
48
+					 . '" id="'
49
+					 . $html_id
50
+					 . '-lbl" class="ee-checkbox-label-after'
51
+					 . $label_size_class
52
+					 . '">';
53
+			$html .= EEH_HTML::nl(1, 'checkbox');
54
+			$html .= '<input type="checkbox"';
55
+			$html .= ' name="' . $input->html_name() . '[]"';
56
+			$html .= ' id="' . $html_id . '"';
57
+			$html .= ' class="' . $input->html_class() . '"';
58
+			$html .= ' style="' . $input->html_style() . '"';
59
+			$html .= ' value="' . esc_attr($value) . '"';
60
+			$html .= ! empty($input_raw_value) && in_array($value, $input_raw_value, true)
61
+				? ' checked="checked"'
62
+				: '';
63
+			$html .= ' ' . $this->_input->other_html_attributes();
64
+			$html .= ' data-question_label="' . $input->html_label_id() . '"';
65
+			$html .= '>&nbsp;';
66
+			$html .= $display_text;
67
+			$html .= EEH_HTML::nl(-1, 'checkbox') . '</label>';
68
+		}
69
+		return $html;
70
+	}
71 71
 }
Please login to merge, or discard this patch.