Completed
Branch BUG-10626-dst-unit-test (8d5d80)
by
unknown
14:30
created

EE_Psr4AutoloaderInit::psr4_loader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
defined('EVENT_ESPRESSO_VERSION') || exit;
3
4
5
6
/**
7
 * Class EE_Psr4AutoloaderInit
8
 *
9
 * Loads the Psr4Autoloader class and registers namespaces
10
 *
11
 * @package 			Event Espresso
12
 * @subpackage 	core
13
 * @author 				Brent Christensen
14
 * @since 				4.8
15
 *
16
 */
17
18
class EE_Psr4AutoloaderInit {
19
20
21
	/**
22
	 * @type \EventEspresso\core\Psr4Autoloader
23
	 */
24
	protected static $psr4_loader;
25
26
27
28
	/**
29
	 * @return \EventEspresso\core\Psr4Autoloader
30
	 */
31
	public function initializeAutoloader() {
32
        static $initialized = false;
33
        if ( ! $initialized) {
34
            // instantiate PSR4 autoloader
35
            EE_Psr4AutoloaderInit::$psr4_loader = new \EventEspresso\core\Psr4Autoloader();
36
            // register the autoloader
37
            EE_Psr4AutoloaderInit::$psr4_loader->register();
38
            // register the base directories for the namespace prefix
39
            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspresso', EE_PLUGIN_DIR_PATH);
40
            EE_Psr4AutoloaderInit::$psr4_loader->addNamespace('EventEspressoBatchRequest', EE_LIBRARIES . 'batch');
41
            $initialized = true;
42
        }
43
    }
44
45
46
47
	/**
48
	 * @return \EventEspresso\core\Psr4Autoloader
49
	 */
50
	public static function psr4_loader() {
51
		return self::$psr4_loader;
52
	}
53
54
55
56
}
57
// End of file EE_Psr4AutoloaderInit.core.php
58
// Location: /core/EE_Psr4AutoloaderInit.core.php