-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinit.php
47 lines (36 loc) · 1.1 KB
/
init.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace TypeRocket\Core;
// Run TypeRocket only once
if( defined('TR_PATH') )
return;
// Define TypeRocket root path
define('TR_PATH', __DIR__ );
// Define TypeRocket alternate path
if( !defined('TR_ALT_PATH') )
define('TR_ALT_PATH', TR_PATH);
// Define TypeRocket alternate path
if( !defined('TR_APP_ROOT_PATH') )
define('TR_APP_ROOT_PATH', TR_ALT_PATH);
// Define App Namespace
if( !defined('TR_APP_NAMESPACE') )
define('TR_APP_NAMESPACE', 'App');
// Define App auto loader
if( !defined('TR_AUTOLOAD_APP') )
define('TR_AUTOLOAD_APP', ['prefix' => TR_APP_NAMESPACE . '\\', 'folder' => __DIR__ . '/app/']);
// Run vendor autoloader
if( !defined('TR_AUTO_LOADER') )
require __DIR__ . '/vendor/autoload.php';
else
call_user_func(TR_AUTO_LOADER);
// Run app autoloader
$tr_autoload_map = TR_AUTOLOAD_APP;
tr_autoload_psr4($tr_autoload_map);
// Define configuration path
if( !defined('TR_CORE_CONFIG_PATH') )
define('TR_CORE_CONFIG_PATH', __DIR__ . '/config' );
// Boot container
( new Container )->boot();
// Load TypeRocket
if (defined('WPINC')) {
(new System)->boot();
}