Skip to content

Commit 76c6bc7

Browse files
authored
[BUGFIX] Try composer autoload of tool installation folder first (#268)
"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 eeca11d commit 76c6bc7

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)