1 | <?php |
||
2 | /** |
||
3 | * This file is part of the O2System PHP Framework package. |
||
4 | * |
||
5 | * For the full copyright and license information, please view the LICENSE |
||
6 | * file that was distributed with this source code. |
||
7 | * |
||
8 | * @author Steeve Andrian Salim |
||
9 | * @copyright Copyright (c) Steeve Andrian Salim |
||
10 | */ |
||
11 | // ------------------------------------------------------------------------ |
||
12 | |||
13 | // Valid PHP Version? |
||
14 | $minPHPVersion = '7.2'; |
||
15 | if (phpversion() < $minPHPVersion) |
||
16 | { |
||
17 | die("Your PHP version must be {$minPHPVersion} or higher to run O2System. Current version: " . phpversion()); |
||
18 | } |
||
19 | unset($minPHPVersion); |
||
20 | |||
21 | // ------------------------------------------------------------------------ |
||
22 | |||
23 | define( 'STARTUP_TIME', microtime( true ) ); |
||
24 | define( 'STARTUP_MEMORY', memory_get_usage( true ) ); |
||
25 | |||
26 | /* |
||
27 | *--------------------------------------------------------------- |
||
28 | * APPLICATION ENVIRONMENT |
||
29 | *--------------------------------------------------------------- |
||
30 | * |
||
31 | * You can load different configurations depending on your |
||
32 | * current environment. Setting the environment also influences |
||
33 | * things like logging and error reporting. |
||
34 | * |
||
35 | * This can be set to anything, but default usage is: |
||
36 | * |
||
37 | * development |
||
38 | * testing |
||
39 | * production |
||
40 | * |
||
41 | * NOTE: If you change these, also change the error_reporting() code below |
||
42 | * |
||
43 | */ |
||
44 | if ( ! defined( 'ENVIRONMENT' ) ) { |
||
45 | /** |
||
46 | * Environment Stage |
||
47 | * |
||
48 | * @value DEVELOPMENT|TESTING|PRODUCTION |
||
49 | */ |
||
50 | define( 'ENVIRONMENT', 'DEVELOPMENT' ); |
||
51 | |||
52 | /** |
||
53 | * Environment Debug Stage |
||
54 | * |
||
55 | * @value DEVELOPER|TESTER|PUBLIC |
||
56 | */ |
||
57 | $_ENV[ 'DEBUG_STAGE' ] = 'DEVELOPER'; |
||
58 | } |
||
59 | |||
60 | /* |
||
61 | *--------------------------------------------------------------- |
||
62 | * APP FOLDER NAME |
||
63 | *--------------------------------------------------------------- |
||
64 | * |
||
65 | * Application folder name. |
||
66 | * |
||
67 | * NO TRAILING SLASH! |
||
68 | */ |
||
69 | if ( ! defined( 'DIR_APP' ) ) { |
||
70 | define( 'DIR_APP', 'app' ); |
||
71 | } |
||
72 | |||
73 | /* |
||
74 | *--------------------------------------------------------------- |
||
75 | * CACHE FOLDER NAME |
||
76 | *--------------------------------------------------------------- |
||
77 | * |
||
78 | * Caching folder name. |
||
79 | * |
||
80 | * NO TRAILING SLASH! |
||
81 | */ |
||
82 | if ( ! defined( 'DIR_CACHE' ) ) { |
||
83 | define( 'DIR_CACHE', 'cache' ); |
||
84 | } |
||
85 | |||
86 | /* |
||
87 | *--------------------------------------------------------------- |
||
88 | * STORAGE FOLDER NAME |
||
89 | *--------------------------------------------------------------- |
||
90 | * |
||
91 | * Storage folder name. |
||
92 | * |
||
93 | * NO TRAILING SLASH! |
||
94 | */ |
||
95 | if ( ! defined( 'DIR_STORAGE' ) ) { |
||
96 | define( 'DIR_STORAGE', 'storage' ); |
||
97 | } |
||
98 | |||
99 | /* |
||
100 | *--------------------------------------------------------------- |
||
101 | * RESOURCES FOLDER NAME |
||
102 | *--------------------------------------------------------------- |
||
103 | * |
||
104 | * Resources folder name. |
||
105 | * |
||
106 | * NO TRAILING SLASH! |
||
107 | */ |
||
108 | if ( ! defined( 'DIR_RESOURCES' ) ) { |
||
109 | define( 'DIR_RESOURCES', 'resources' ); |
||
110 | } |
||
111 | |||
112 | /* |
||
113 | *--------------------------------------------------------------- |
||
114 | * DATABASE FOLDER NAME |
||
115 | *--------------------------------------------------------------- |
||
116 | * |
||
117 | * Database folder name. |
||
118 | * |
||
119 | * NO TRAILING SLASH! |
||
120 | */ |
||
121 | if ( ! defined( 'DIR_DATABASE' ) ) { |
||
122 | define( 'DIR_DATABASE', 'database' ); |
||
123 | } |
||
124 | |||
125 | /* |
||
126 | *--------------------------------------------------------------- |
||
127 | * PUBLIC FOLDER NAME |
||
128 | *--------------------------------------------------------------- |
||
129 | * |
||
130 | * Accessible folder by public. |
||
131 | * |
||
132 | * NO TRAILING SLASH! |
||
133 | */ |
||
134 | if ( ! defined( 'DIR_PUBLIC' ) ) { |
||
135 | // cpanel based hosting |
||
136 | if(is_dir('../public_html')) { |
||
137 | define( 'DIR_PUBLIC', 'public' ); |
||
138 | } else { |
||
139 | define( 'DIR_PUBLIC', 'public' ); |
||
140 | } |
||
141 | } |
||
142 | |||
143 | /* |
||
144 | *--------------------------------------------------------------- |
||
145 | * DEFINE ROOT PATH |
||
146 | *--------------------------------------------------------------- |
||
147 | */ |
||
148 | define( 'PATH_ROOT', dirname( __FILE__ ) . DIRECTORY_SEPARATOR ); |
||
149 | |||
150 | /* |
||
151 | *--------------------------------------------------------------- |
||
152 | * POINTING FRONT CONTROLLER DIRECTORY |
||
153 | *--------------------------------------------------------------- |
||
154 | * |
||
155 | * Ensure the current directory is pointing to the front controller's directory |
||
156 | */ |
||
157 | chdir( __DIR__ . DIRECTORY_SEPARATOR ); |
||
158 | |||
159 | /* |
||
160 | |-------------------------------------------------------------------------- |
||
161 | | Register The Composer Auto Loader |
||
162 | |-------------------------------------------------------------------------- |
||
163 | | |
||
164 | | Composer provides a convenient, automatically generated class loader |
||
165 | | for our application. We just need to utilize it! We'll require it |
||
166 | | into the script here so that we do not have to worry about the |
||
167 | | loading of any our classes "manually". Feels great to relax. |
||
168 | | |
||
169 | */ |
||
170 | require __DIR__ . '/vendor/autoload.php'; |
||
171 | |||
172 | /* |
||
173 | * ------------------------------------------------------ |
||
174 | * STARTUP O2SYSTEM |
||
175 | * ------------------------------------------------------ |
||
176 | */ |
||
177 | if ( class_exists( 'O2System\Framework', false ) ) { |
||
178 | O2System\Framework::getInstance(); |
||
0 ignored issues
–
show
|
|||
179 | } |
||
180 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths