-
Notifications
You must be signed in to change notification settings - Fork 4
/
constants.php
101 lines (80 loc) · 3.76 KB
/
constants.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
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
/**
* ————————————————————————————————————————————————————————————————————————————————
* WEBTIGERS Copyright Notice
* ————————————————————————————————————————————————————————————————————————————————
*
* Copyright © 2020 WebTigers
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of WebTigers.
* The intellectual and technical concepts contained herein are proprietary to
* WebTigers and may be covered by U.S. and Foreign Patents, patents in process, and
* are protected by trade secret or copyright law. Dissemination of this information
* or reproduction of this material is strictly forbidden unless prior written
* permission is obtained from WebTigers.
*
* See the LICENSE.txt for full licensing information governing the use of this
* information and software.
*/
// AWS load balancing forwards the IP using X-headers
$_SERVER['REMOTE_ADDR'] = ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) )
? $_SERVER['HTTP_X_FORWARDED_FOR']
: $_SERVER['REMOTE_ADDR'];
$https = ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' )
? true
: ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' );
defined('HTTPS')
|| define('HTTPS', $https);
// Define path to public directory
defined('PUBLIC_PATH')
|| define('PUBLIC_PATH', realpath(dirname(__FILE__) . '/public'));
// Define path to public directory
defined('ASSETS_PATH')
|| define('ASSETS_PATH', realpath(dirname(__FILE__) . '/public/assets'));
// Define path to modules directory
defined('MODULES_PATH')
|| define('MODULES_PATH', realpath(dirname(__FILE__) . '/application/modules'));
// Define path to themes directory (same as modules)
defined('THEMES_PATH')
|| define('THEMES_PATH', realpath(dirname(__FILE__) . '/application/modules'));
// Define path to application directory
defined('CORE_MODULE_PATH')
|| define('CORE_MODULE_PATH', realpath(dirname(__FILE__) . '/application/modules/core'));
// Define path to vendor directory
defined('VENDOR_PATH')
|| define('VENDOR_PATH', realpath(dirname(__FILE__) . '/../tiger-vendor/vendor'));
// Define path to library directory
defined('CORE_LIBRARY_PATH')
|| define('CORE_LIBRARY_PATH', realpath(dirname(__FILE__) . '/application/modules/core/library'));
// Define path to library directory
defined('TIGER_CONFIG_PATH')
|| define('TIGER_CONFIG_PATH', realpath(dirname(__FILE__) . '/../tiger-config'));
// Define path to logs directory
defined('LOG_PATH')
|| define('LOG_PATH', realpath(dirname(__FILE__) . '/../tiger-logs'));
// Define path to the file upload directory
defined('UPLOAD_PATH')
|| define('UPLOAD_PATH', realpath(dirname(__FILE__) . '/upload'));
// Define path to the temporary file directory
defined('TMP_PATH')
|| define('TMP_PATH', realpath(dirname(__FILE__) . '/tmp'));
// Define path to the temporary file directory
defined('TEST_PATH')
|| define('TEST_PATH', realpath(dirname(__FILE__) . '/tests'));
defined('TIGER_ID')
|| define('TIGER_ID', '00000000-0000-0000-0000-000000000000');
// Define application environment
$env = 'production';
if (getenv('APPLICATION_ENV')){
$env = getenv('APPLICATION_ENV');
}
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', $env);
// Define maintenance mode
$maint = false;
if (getenv('APPLICATION_MAINT')){
$maint = ( getenv('APPLICATION_MAINT') === 'true' ) ? true : false;
}
defined('APPLICATION_MAINT')
|| define('APPLICATION_MAINT', $maint);