diff --git a/src/cli/flow b/src/cli/flow index 0e549194c..d252972b6 100644 --- a/src/cli/flow +++ b/src/cli/flow @@ -10,7 +10,17 @@ use Symfony\Component\Console\Application; if ('' !== Phar::running(false)) { require 'phar://flow.phar/vendor/autoload.php'; } else { - require __DIR__ . '/../vendor/autoload.php'; + if (\is_file(__DIR__ . '/vendor/autoload.php')) { + $autoloader = require __DIR__ . '/vendor/autoload.php'; + } elseif (\is_file(__DIR__ . '/../vendor/autoload.php')) { + $autoloader = require __DIR__ . '/../vendor/autoload.php'; + } elseif (\is_file(__DIR__ . '/../../../autoload.php')) { + $autoloader = require __DIR__ . '/../../../autoload.php'; + } else { + echo 'Cannot find the vendor directory, have you executed composer install?' . PHP_EOL; + echo 'See https://getcomposer.org to get Composer.' . PHP_EOL; + exit(1); + } } if (false === \in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {