Skip to content

Commit 815a16c

Browse files
committed
Fix autoloading when installed globally with composer
1 parent 246b743 commit 815a16c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/docker-hostmanager

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ if (PHP_SAPI !== 'cli') {
55
die('Warning: docker-hostmanager must be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL);
66
}
77

8-
require __DIR__.'/../vendor/autoload.php';
8+
foreach ([__DIR__.'/../vendor/autoload.php', __DIR__.'/../../../autoload.php'] as $file) {
9+
if (file_exists($file)) {
10+
require $file;
11+
break;
12+
}
13+
}
914

1015
use DockerHostManager\Command\SynchronizeHostsCommand;
1116
use Symfony\Component\Console\Application;

0 commit comments

Comments
 (0)