We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e1d28d commit c328d94Copy full SHA for c328d94
1 file changed
src/support/helpers.php
@@ -34,7 +34,19 @@
34
* Get the base path of the application
35
*/
36
if (!defined('BASE_PATH')) {
37
- define('BASE_PATH', Phar::running() ?: getcwd());
+ if (!$basePath = Phar::running()) {
38
+ $basePath = getcwd();
39
+ while ($basePath !== dirname($basePath)) {
40
+ if (is_dir("$basePath/vendor") && is_file("$basePath/start.php")) {
41
+ break;
42
+ }
43
+ $basePath = dirname($basePath);
44
45
+ if ($basePath === dirname($basePath)) {
46
+ $basePath = __DIR__ . '/../../../../../';
47
48
49
+ define('BASE_PATH', realpath($basePath) ?: $basePath);
50
}
51
52
if (!function_exists('run_path')) {
0 commit comments