Skip to content

Commit 91e89f4

Browse files
committed
Fix the path when null in dirname()
Don’t try to fix things late at night…
1 parent 69da3d6 commit 91e89f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

config/bootstrap.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
foreach ([$confDir, 'spm_projects.d', '.config/spm_projects.d', '.spm_projects.d'] as $test) {
1212
$test = sprintf('%s/%s/.env', $homeDir, $test);
13-
13+
1414
if (file_exists($test)) {
1515
$envFile = $test;
1616
break;
@@ -31,7 +31,7 @@
3131
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
3232
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
3333

34-
$_SERVER['SOMNAMBULIST_PROJECTS_CONFIG_DIR'] = dirname($envFile);
34+
$_SERVER['SOMNAMBULIST_PROJECTS_CONFIG_DIR'] = dirname($envFile ?? $_SERVER['HOME'] . '/.config/spm_projects.d/.env');
3535
$_SERVER['SOMNAMBULIST_ACTIVE_PROJECT'] = $_ENV['SOMNAMBULIST_ACTIVE_PROJECT'] = ($_SERVER['SOMNAMBULIST_ACTIVE_PROJECT'] ?? $_ENV['SOMNAMBULIST_ACTIVE_PROJECT'] ?? null) ?: null;
3636
$_SERVER['PROJECT_LIBRARIES_DIR'] = $_ENV['PROJECT_LIBRARIES_DIR'] = ($_SERVER['PROJECT_LIBRARIES_DIR'] ?? $_ENV['PROJECT_LIBRARIES_DIR'] ?? null) ?: null;
3737
$_SERVER['PROJECT_SERVICES_DIR'] = $_ENV['PROJECT_SERVICES_DIR'] = ($_SERVER['PROJECT_SERVICES_DIR'] ?? $_ENV['PROJECT_SERVICES_DIR'] ?? null) ?: null;

0 commit comments

Comments
 (0)