fixed search project root directory

This commit is contained in:
2026-02-09 06:39:02 +01:00
parent 2dbaa2bf77
commit ff5663282f

View File

@ -191,9 +191,9 @@ if ($suc) {
function findProjectRoot(string $startDir): ?string function findProjectRoot(string $startDir): ?string
{ {
$dir = realpath($startDir); $dir = realpath($startDir);
if (!$dir) return null;
while ($dir && $dir !== dirname($dir)) { while ($dir && $dir !== dirname($dir)) {
if (file_exists($dir . '/composer.json')) { if (is_file($dir . '/vendor/autoload.php')) {
return $dir; return $dir;
} }
$dir = dirname($dir); $dir = dirname($dir);