Skip to content

Commit b63cc6d

Browse files
committed
[BUGFIX] Try composer autoload of tool installation folder first
"fractor" as a tool may/should not be installed as a project dependency, but live separately. Hence, the authoritative composer autoload is the one where the tool has been installed to. For legacy reasons the project's autoload information is kept as a fallback. Resolves: #264
1 parent 6547682 commit b63cc6d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/fractor/bin/fractor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99

1010
$autoloadFile = (static function (): ?string {
1111
$candidates = [
12-
getcwd() . '/vendor/autoload.php',
12+
// first try the vendor folder, where fractor is installed to
1313
__DIR__ . '/../../../autoload.php',
1414
__DIR__ . '/../vendor/autoload.php',
15+
// fallback to the project's vendor folder
16+
getcwd() . '/vendor/autoload.php',
1517
];
1618
foreach ($candidates as $candidate) {
1719
if (file_exists($candidate)) {

0 commit comments

Comments
 (0)