Skip to content

Commit

Permalink
Merge pull request #50 from adamkiss/main
Browse files Browse the repository at this point in the history
Add check for index() expecting to live in vendor/ directory
  • Loading branch information
bastianallgeier authored Dec 5, 2023
2 parents 0af5f38 + f5ed54b commit c94ded7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ function index(): string|null
];

foreach ($locations as $location) {
// try to find the index.php in current working directory
$index = realpath(getcwd() . '/' . $location . '/index.php');

if ($index !== false) {
return $index;
}

// try to find the index.php from the (possible) root of the project
// in the __ROOT__ <- /vendor/getkirby/cli directory
$index = realpath(dirname(__DIR__, 3) . '/' . $location . '/index.php');

if ($index !== false) {
return $index;
}
}

return null;
Expand Down

0 comments on commit c94ded7

Please sign in to comment.