From 815a16cc7a20a320af4ce990b89137c09d5b9596 Mon Sep 17 00:00:00 2001 From: iamluc Date: Sun, 24 Apr 2016 15:19:15 +0200 Subject: [PATCH] Fix autoloading when installed globally with composer --- bin/docker-hostmanager | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/docker-hostmanager b/bin/docker-hostmanager index d5e7547..67ed053 100755 --- a/bin/docker-hostmanager +++ b/bin/docker-hostmanager @@ -5,7 +5,12 @@ if (PHP_SAPI !== 'cli') { die('Warning: docker-hostmanager must be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL); } -require __DIR__.'/../vendor/autoload.php'; +foreach ([__DIR__.'/../vendor/autoload.php', __DIR__.'/../../../autoload.php'] as $file) { + if (file_exists($file)) { + require $file; + break; + } +} use DockerHostManager\Command\SynchronizeHostsCommand; use Symfony\Component\Console\Application;