Skip to content

Commit

Permalink
Merge pull request #45 from swiftotter/21-config-loader-fix
Browse files Browse the repository at this point in the history
#21: Fix for config loader when `vendor/bin/driver` is a symlink
  • Loading branch information
JesseMaxwell authored Oct 6, 2022
2 parents cf94a3d + 9285a24 commit cdd7c49
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/System/Configuration/FolderCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public function create(array $allowedFolders): FolderCollection
*/
private function getSearchPaths(): array
{
$directory = realpath($_SERVER['SCRIPT_FILENAME']);
if (strpos($directory, self::VENDOR_DIRECTORY) !== false) {
list($rootDir) = explode(self::VENDOR_DIRECTORY, $directory);
$fullPath = $_SERVER['PWD'] . '/' . $_SERVER['SCRIPT_FILENAME'];
if (strpos($fullPath, self::VENDOR_DIRECTORY) !== false) {
list($rootDir) = explode(self::VENDOR_DIRECTORY, $fullPath);
return array_merge([$rootDir], $this->getVendorDirectories($rootDir));
}
return [dirname($directory, 2)];
return [dirname($fullPath, 2)];
}

/**
Expand Down

0 comments on commit cdd7c49

Please sign in to comment.