File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 14
14
use Qubus \Expressive \OrmBuilder ;
15
15
use ReflectionException ;
16
16
17
+ use function dirname ;
18
+ use function getcwd ;
17
19
use function is_int ;
18
20
use function Qubus \Security \Helpers \__observer ;
19
21
use function Qubus \Support \Helpers \is_false__ ;
20
22
use function Qubus \Support \Helpers \is_null__ ;
21
23
use function file_exists ;
22
24
use function in_array ;
23
25
use function is_string ;
26
+ use function realpath ;
24
27
use function rtrim ;
25
28
use function sprintf ;
26
29
use function substr_count ;
@@ -68,20 +71,12 @@ function config(string $key, array|bool $set = false): mixed
68
71
*/
69
72
function get_fresh_bootstrap (): mixed
70
73
{
71
- if (file_exists (filename: $ file = __DIR__ . '/../../../../../bootstrap/app.php ' )) {
72
- return require ($ file );
73
- } elseif (file_exists (filename: $ file = __DIR__ . '/../../../../bootstrap/app.php ' )) {
74
- return require ($ file );
75
- } elseif (file_exists (filename: $ file = __DIR__ . '/../../bootstrap/app.php ' )) {
76
- return require ($ file );
77
- } elseif (
78
- file_exists (
79
- filename: $ file = rtrim (string: (string ) env (key: 'APP_BASE_PATH ' ), characters: '/ ' ) . '/bootstrap/app.php '
80
- )
81
- ) {
82
- return require ($ file );
74
+ if (file_exists (filename: $ file = getcwd () . '/bootstrap/app.php ' )) {
75
+ return require (realpath (path: $ file ));
76
+ } elseif (file_exists (filename: $ file = dirname (path: getcwd ()) . '/bootstrap/app.php ' )) {
77
+ return require (realpath (path: $ file ));
83
78
} else {
84
- return require (__DIR__ . '/../ bootstrap/app.php ' );
79
+ return require (realpath (path: dirname (path: getcwd ()) . '/bootstrap/app.php ' ) );
85
80
}
86
81
}
87
82
You can’t perform that action at this time.
0 commit comments