Completed
Branch BUG-9054-ee-config (5f56da)
by
unknown
255:53 queued 241:21
created

EE_Psr4AutoloaderInit   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 37
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 2
A psr4_loader() 0 3 1
1
<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2
/**
3
 * Class EE_Psr4AutoloaderInit
4
 *
5
 * Loads the Psr4Autoloader class and registers namespaces
6
 *
7
 * @package 			Event Espresso
8
 * @subpackage 	core
9
 * @author 				Brent Christensen
10
 * @since 				4.8
11
 *
12
 */
13
14
class EE_Psr4AutoloaderInit {
15
16
17
	/**
18
	 * @type \EventEspresso\Core\Psr4Autoloader
19
	 */
20
	protected static $psr4_loader;
21
22
	/**
23
	 * @access    public
24
	 */
25
	public function __construct() {
26
		static $initialized = false;
27
		if ( ! $initialized ) {
28
			// instantiate PSR4 autoloader
29
			espresso_load_required( 'Psr4Autoloader', EE_CORE . 'Psr4Autoloader.php' );
30
			EE_Psr4AutoloaderInit::$psr4_loader = new \EventEspresso\Core\Psr4Autoloader();
31
			// register the autoloader
32
			EE_Psr4AutoloaderInit::$psr4_loader->register();
33
			// register the base directories for the namespace prefix
34
			EE_Psr4AutoloaderInit::$psr4_loader->addNamespace( 'EventEspresso', EE_PLUGIN_DIR_PATH );
35
			$initialized = true;
36
		}
37
	}
38
39
40
41
	/**
42
	 * @return \EventEspresso\Core\Psr4Autoloader
43
	 */
44
	public static function psr4_loader() {
45
		return self::$psr4_loader;
46
	}
47
48
49
50
}
51
// End of file EE_Psr4AutoloaderInit.core.php
52
// Location: /core/EE_Psr4AutoloaderInit.core.php