-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbootstrap.php
More file actions
101 lines (80 loc) · 2.78 KB
/
Copy pathbootstrap.php
File metadata and controls
101 lines (80 loc) · 2.78 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
declare(strict_types=1);
/*
* This file is part of the Thelia package.
* http://www.thelia.net
*
* (c) OpenStudio <info@thelia.net>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/*
* Thelia essential definitions
*/
if (!defined('DS')) {
define('DS', \DIRECTORY_SEPARATOR);
}
if (!defined('THELIA_ROOT')) {
define('THELIA_ROOT', rtrim(realpath(dirname(__DIR__)), DS).DS);
}
if (!defined('THELIA_LIB')) {
define('THELIA_LIB', THELIA_ROOT.'core'.DS.'lib'.DS.'Thelia'.DS);
}
if (!defined('THELIA_VENDOR')) {
define('THELIA_VENDOR', THELIA_ROOT.'vendor'.DS);
}
if (!defined('THELIA_VENDOR_ROOT')) {
define('THELIA_VENDOR_ROOT', THELIA_VENDOR.'thelia'.DS);
}
if (!defined('THELIA_LOCAL_DIR')) {
define('THELIA_LOCAL_DIR', THELIA_ROOT.'local'.DS);
}
if (!defined('THELIA_CONF_DIR')) {
$pathConfDir = THELIA_LOCAL_DIR.'config'.DS;
if (is_file($pathConfDir.'schema.xml')) {
define('THELIA_CONF_DIR', $pathConfDir);
} else {
define('THELIA_CONF_DIR', THELIA_VENDOR.'thelia'.DS.'config'.DS);
}
}
if (!defined('THELIA_MODULE_DIR')) {
define('THELIA_MODULE_DIR', THELIA_VENDOR.'thelia'.DS.'modules'.DS);
}
if (!defined('THELIA_LOCAL_MODULE_DIR')) {
define('THELIA_LOCAL_MODULE_DIR', THELIA_LOCAL_DIR.'modules'.DS);
}
if (!defined('THELIA_WEB_DIR')) {
define('THELIA_WEB_DIR', THELIA_ROOT.'public'.DS);
}
if (!defined('THELIA_WEB_ASSETS_DIR')) {
define('THELIA_WEB_ASSETS_DIR', THELIA_ROOT.'public'.DS.'assets'.DS);
}
if (!defined('THELIA_CACHE_DIR')) {
define('THELIA_CACHE_DIR', THELIA_ROOT.'var'.DS.'cache'.DS);
}
if (!defined('THELIA_LOG_DIR')) {
define('THELIA_LOG_DIR', THELIA_ROOT.'var'.DS.'log'.DS);
}
if (!defined('THELIA_TEMPLATE_DIR')) {
define('THELIA_TEMPLATE_DIR', THELIA_ROOT.'templates'.DS);
}
if (!defined('THELIA_TEMPLATE_FRONTOFFICE_DIR')) {
define('THELIA_TEMPLATE_FRONTOFFICE_DIR', THELIA_TEMPLATE_DIR.'frontOffice'.DS);
}
if (!defined('THELIA_SETUP_DIRECTORY')) {
// A setup/ directory at the project root is the source the project itself
// ships, so it wins over the thelia/setup package, the same way local/config
// wins over thelia/config above. A project installed with Composer has no
// root setup/ and keeps using the package.
if (is_dir(THELIA_ROOT.'setup'.DS)) {
define('THELIA_SETUP_DIRECTORY', THELIA_ROOT.'setup'.DS);
} elseif (is_dir(THELIA_VENDOR.'thelia'.DS.'setup'.DS)) {
define('THELIA_SETUP_DIRECTORY', THELIA_VENDOR.'thelia'.DS.'setup'.DS);
} else {
define('THELIA_SETUP_DIRECTORY', THELIA_LOCAL_DIR.'setup'.DS);
}
}
if (!defined('THELIA_SETUP_WIZARD_DIRECTORY')) {
define('THELIA_SETUP_WIZARD_DIRECTORY', THELIA_ROOT.'public'.DS.'install'.DS);
}